Merge pull request #7066 from owncloud/check_svg_installed
properly check if pdf and svg modules are installed
This commit is contained in:
commit
8c7fb64b8b
|
@ -6,7 +6,7 @@
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*/
|
*/
|
||||||
//both, libreoffice backend and php fallback, need imagick
|
//both, libreoffice backend and php fallback, need imagick
|
||||||
if (extension_loaded('imagick')) {
|
if (extension_loaded('imagick') && count(\Imagick::queryFormats("PDF")) === 1) {
|
||||||
$isShellExecEnabled = \OC_Helper::is_function_enabled('shell_exec');
|
$isShellExecEnabled = \OC_Helper::is_function_enabled('shell_exec');
|
||||||
|
|
||||||
// LibreOffice preview is currently not supported on Windows
|
// LibreOffice preview is currently not supported on Windows
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
namespace OC\Preview;
|
namespace OC\Preview;
|
||||||
|
|
||||||
if (extension_loaded('imagick')) {
|
if (extension_loaded('imagick') && count(\Imagick::queryFormats("PDF")) === 1) {
|
||||||
|
|
||||||
class PDF extends Provider {
|
class PDF extends Provider {
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
namespace OC\Preview;
|
namespace OC\Preview;
|
||||||
|
|
||||||
if (extension_loaded('imagick')) {
|
if (extension_loaded('imagick') && count(\Imagick::queryFormats("SVG")) === 1) {
|
||||||
|
|
||||||
class SVG extends Provider {
|
class SVG extends Provider {
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Unknown extends Provider {
|
||||||
|
|
||||||
$svgPath = substr_replace($path, 'svg', -3);
|
$svgPath = substr_replace($path, 'svg', -3);
|
||||||
|
|
||||||
if (extension_loaded('imagick') && file_exists($svgPath)) {
|
if (extension_loaded('imagick') && file_exists($svgPath) && count(\Imagick::queryFormats("SVG")) === 1) {
|
||||||
|
|
||||||
// http://www.php.net/manual/de/imagick.setresolution.php#85284
|
// http://www.php.net/manual/de/imagick.setresolution.php#85284
|
||||||
$svg = new \Imagick();
|
$svg = new \Imagick();
|
||||||
|
|
Loading…
Reference in New Issue