Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix imagick generate office files
Browse files Browse the repository at this point in the history
Sometimes unoconv is failed to generate office file and can give a zero file. In this case the file will be never re-generate.
  • Loading branch information
c12simple committed Oct 30, 2015
1 parent c480912 commit 2a9b28d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/plugins/editor.imagick/class.IMagickPreviewer.php
Expand Up @@ -275,7 +275,7 @@ public function generateJpegsCallback($masterFile, $targetFile)
chdir($workingDir);
if ($unoconv !== false && in_array(strtolower($extension), $officeExt)) {
$unoDoc = preg_replace("/(-[0-9]+)?\\.jpg/", "_unoconv.pdf", $tmpFileThumb);
if (!is_file($unoDoc)) {
if (!is_file($unoDoc) || (is_file($unoDoc) && (filesize($unoDoc) == 0))) {
if (stripos(PHP_OS, "win") === 0) {
$unoconv = $this->pluginConf["UNOCONV"]." -o ".escapeshellarg(basename($unoDoc))." -f pdf ".escapeshellarg($masterFile);
} else {
Expand Down

0 comments on commit 2a9b28d

Please sign in to comment.