From: Michael J. Rubinsky Date: Mon, 15 Feb 2010 18:27:37 +0000 (-0500) Subject: Don't assume we have a Horde_Image driver available X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c84df4389c0f91d36a75a48e25810b285f2552ea;p=horde.git Don't assume we have a Horde_Image driver available --- diff --git a/imp/lib/Mime/Viewer/Images.php b/imp/lib/Mime/Viewer/Images.php index 98b25bc78..04b29f37d 100644 --- a/imp/lib/Mime/Viewer/Images.php +++ b/imp/lib/Mime/Viewer/Images.php @@ -250,16 +250,18 @@ EOD; */ protected function _getHordeImageOb($load) { + if (!$GLOBALS['conf']['image']['driver']) { + return false; + } $img = null; //@TODO: Pass in a Horde_Logger in $context if desired. $context = array('tmpdir' => Horde::getTempDir()); try { if (!empty($GLOBALS['conf']['image']['convert'])) { $context['convert'] = $GLOBALS['conf']['image']['convert']; - $img = Horde_Image::factory('Im', array('context' => $context)); - } elseif (Horde_Util::extensionExists('gd')) { - $img = Horde_Image::factory('Gd', array('context' => $context)); + $context['identify'] = $GLOBALS['conf']['image']['identify']; } + $img = Horde_Image::factory($GLOBALS['conf']['image']['driver']); } catch (Horde_Image_Exception $e) { return false; }