From 14d538c79329a7b6e4e8797977629672f7c47f28 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 7 Oct 2014 15:14:06 -0700 Subject: check the imagick version before using it. --- include/photo/photo_driver.php | 20 ++++++++++++++++---- version.inc | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index e8afac119..42997060b 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -2,13 +2,25 @@ function photo_factory($data, $type = null) { $ph = null; + $ignore_imagick = get_config('system', 'ignore_imagick'); + if(class_exists('Imagick') && !$ignore_imagick) { - logger('photo_factory: using Imagick', LOGGER_DEBUG); - require_once('include/photo/photo_imagick.php'); - $ph = new photo_imagick($data,$type); + $v = Imagick::getVersion(); + preg_match('/ImageMagick ([0-9]+\.[0-9]+\.[0-9]+)/', $v['versionString'], $m); + if(version_compare($m[1],'6.6.7') >= 0) { + require_once('include/photo/photo_imagick.php'); + $ph = new photo_imagick($data,$type); + } + else { + // earlier imagick versions have issues with scaling png's + // don't log this because it will just fill the logfile. + // leave this note here so those who are looking for why + // we aren't using imagick can find it + } } - else { + + if(! $ph) { require_once('include/photo/photo_gd.php'); $ph = new photo_gd($data,$type); } diff --git a/version.inc b/version.inc index a5c162410..203193fb7 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2014-10-06.820 +2014-10-07.821 -- cgit v1.2.3