aboutsummaryrefslogtreecommitdiffstats
path: root/include/photo/photo_driver.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-10-07 15:14:06 -0700
committerfriendica <info@friendica.com>2014-10-07 15:14:06 -0700
commit14d538c79329a7b6e4e8797977629672f7c47f28 (patch)
treeab2d2a3372554e332b0b432fe39175c4c1eccee8 /include/photo/photo_driver.php
parent563163523d740213d941c6f2fc16344fbf88ec25 (diff)
downloadvolse-hubzilla-14d538c79329a7b6e4e8797977629672f7c47f28.tar.gz
volse-hubzilla-14d538c79329a7b6e4e8797977629672f7c47f28.tar.bz2
volse-hubzilla-14d538c79329a7b6e4e8797977629672f7c47f28.zip
check the imagick version before using it.
Diffstat (limited to 'include/photo/photo_driver.php')
-rw-r--r--include/photo/photo_driver.php20
1 files changed, 16 insertions, 4 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);
}