Don't attempt this if we don't have the lqr library
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 26 Sep 2010 20:12:44 +0000 (16:12 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 27 Sep 2010 16:02:40 +0000 (12:02 -0400)
framework/Image/lib/Horde/Image/Effect/Imagick/LiquidResize.php

index 6227c3e..cbc0d8d 100644 (file)
@@ -31,8 +31,14 @@ class Horde_Image_Effect_Imagick_LiquidResize extends Horde_Image_Effect
     {
         $this->_params = new Horde_Support_Array($this->_params);
         try {
-            $this->_image->imagick->liquidRescaleImage(
-                $this->_params->width, $this->_params->height, $this->_params->delta_x, $this->_params['rigidity']);
+            // Only supported if ImageMagick is compiled against lqr library.
+            if (method_exists($this->_image, 'liquidRescaleImage')) {
+                $this->_image->imagick->liquidRescaleImage(
+                    $this->_params->width, $this->_params->height, $this->_params->delta_x, $this->_params['rigidity']);
+            } else {
+                throw new Horde_Image_Exception('Missing support for lqr in ImageMagick.');
+            }
+
         } catch (ImagickException $e) {
             throw new Horde_Image_Exception($e);
         }