check if imagick is loaded in office.php, not in libreoffice-cl.php
This commit is contained in:
parent
2ff97917e9
commit
28cf63d37d
|
@ -8,8 +8,6 @@
|
|||
namespace OC\Preview;
|
||||
|
||||
//we need imagick to convert
|
||||
if (extension_loaded('imagick')) {
|
||||
|
||||
class Office extends Provider {
|
||||
|
||||
private $cmd;
|
||||
|
@ -47,9 +45,7 @@ if (extension_loaded('imagick')) {
|
|||
unlink($abspath);
|
||||
unlink($abspath . '.pdf');
|
||||
|
||||
if (!$image->valid()) return false;
|
||||
|
||||
return $image;
|
||||
return $image->valid() ? $image : false;
|
||||
}
|
||||
|
||||
private function initCmd() {
|
||||
|
@ -74,7 +70,6 @@ if (extension_loaded('imagick')) {
|
|||
$this->cmd = $cmd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//.doc, .dot
|
||||
class MSOfficeDoc extends Office {
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
//both, libreoffice backend and php fallback, need imagick
|
||||
if (extension_loaded('imagick')) {
|
||||
//let's see if there is libreoffice or openoffice on this machine
|
||||
if(shell_exec('libreoffice --headless --version') || shell_exec('openoffice --headless --version') || is_string(\OC_Config::getValue('preview_libreoffice_path', null))) {
|
||||
require_once('libreoffice-cl.php');
|
||||
|
@ -13,3 +15,4 @@ if(shell_exec('libreoffice --headless --version') || shell_exec('openoffice --he
|
|||
require_once('msoffice.php');
|
||||
require_once('opendocument.php');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue