|
@@ -43,20 +43,20 @@ |
|
|
block discarded – undo |
|
43
|
43
|
|
|
44
|
44
|
$tmpDir = \OC::$server->getTempManager()->getTempBaseDir(); |
|
45
|
45
|
|
|
46
|
|
- $defaultParameters = ' -env:UserInstallation=file://' . escapeshellarg($tmpDir . '/owncloud-' . \OC_Util::getInstanceId() . '/') . ' --headless --nologo --nofirststartwizard --invisible --norestore --convert-to png --outdir '; |
|
|
46
|
+ $defaultParameters = ' -env:UserInstallation=file://'.escapeshellarg($tmpDir.'/owncloud-'.\OC_Util::getInstanceId().'/').' --headless --nologo --nofirststartwizard --invisible --norestore --convert-to png --outdir '; |
|
47
|
47
|
$clParameters = \OC::$server->getConfig()->getSystemValue('preview_office_cl_parameters', $defaultParameters); |
|
48
|
48
|
|
|
49
|
|
- $exec = $this->cmd . $clParameters . escapeshellarg($tmpDir) . ' ' . escapeshellarg($absPath); |
|
|
49
|
+ $exec = $this->cmd.$clParameters.escapeshellarg($tmpDir).' '.escapeshellarg($absPath); |
|
50
|
50
|
|
|
51
|
51
|
shell_exec($exec); |
|
52
|
52
|
|
|
53
|
53
|
//create imagick object from png |
|
54
|
54
|
$pngPreview = null; |
|
55
|
55
|
try { |
|
56
|
|
- list($dirname, , , $filename) = array_values(pathinfo($absPath)); |
|
57
|
|
- $pngPreview = $dirname . '/' . $filename . '.png'; |
|
|
56
|
+ list($dirname,,, $filename) = array_values(pathinfo($absPath)); |
|
|
57
|
+ $pngPreview = $dirname.'/'.$filename.'.png'; |
|
58
|
58
|
|
|
59
|
|
- $png = new \imagick($pngPreview . '[0]'); |
|
|
59
|
+ $png = new \imagick($pngPreview.'[0]'); |
|
60
|
60
|
$png->setImageFormat('jpg'); |
|
61
|
61
|
} catch (\Exception $e) { |
|
62
|
62
|
unlink($absPath); |
Please login to merge, or discard this patch.