$doc = $dao->selectById($doc_id);
$files = [
-// ['jpg', 'thumb', true, true, ''],
-// ['jpg', '300', true, true, 'html'],
-// ['jpg', '150', true, true, 'html'],
-// ['jpg', '150', false, true, 'html'],
-// ['jpg', '150', false, true, 'html'],
-// ['svg', '150', true, false, 'html'],
+ ['jpg', 'thumb', true, true, ''],
+ ['jpg', '300', true, true, 'html'],
+ ['jpg', '150', true, true, 'html'],
+ ['jpg', '150', false, true, 'html'],
+ ['jpg', '150', false, true, 'html'],
+ ['png', 'thumb', true, true, ''],
+ ['png', '300', true, true, 'html'],
+ ['png', '150', true, true, 'html'],
+ ['png', '150', false, true, 'html'],
+ ['png', '150', false, true, 'html'],
+ ['svg', '150', true, false, 'html'],
['svg', '300', true, false, 'html'],
-// ['svg', '150', true, true, 'html'],
-// ['svg', '200', true, true, 'html'],
+ ['svg', '150', true, true, 'html'],
+ ['svg', '200', true, true, 'html'],
];
foreach ($files as $file) {
$farmer = self::pickOneFarmServer();
$params = ['page' => $page, 'format' => $format, 'resolution' => $resolution, 'withText' => $withText, 'withGraphics' => $withGraphics, 'version' => $version, 'force' => $force, 'out' => $this->out, 'resolutionRatio' => $this->getResolutionRatio(), 'mobileRatio' => $this->getMobileFirstRatio()];
- $cl = new CubeIT_CommandLine('/usr/local/fluidbook_processfarm/bin/process', null, false);
+ $cl = new CubeIT_CommandLine('/usr/local/fluidbook_processfarm/bin/process', null, true);
$cl->setSSH($farmer['host'], 'fluidbookfarmer', '', $farmer['port'] ?? 22, '/home/extranet/.ssh/id_rsa');
$cl->setManualArg(base64_encode(json_encode($params)));
$cl->execute();
$o = trim($cl->output);
+ if (preg_match('|/data1/extranet/www/[^\s]+|', $o, $matches)) {
+ $o = $matches[0];
+ }
if (file_exists($o)) {
return $o;
+ } else {
+ echo $cl->output;
}
return false;
}