We need to be calling setImageFormat(), not setFormat() here.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 20 Feb 2010 20:32:07 +0000 (15:32 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 20 Feb 2010 20:36:23 +0000 (15:36 -0500)
Damn hard to find this bug, but finally fixes issue causing thumbnails
to loose transparency when applying certain compound effects.

framework/Image/lib/Horde/Image/Imagick.php

index 0e61c1b..3c4ef31 100644 (file)
@@ -87,11 +87,12 @@ class Horde_Image_Imagick extends Horde_Image_Base
         parent::loadString($image_data);
         $this->_imagick->clear();
         try {
-            $this->_imagick->readImageBlob($image_data);
+            $this->_imagick->readImageBlob($this->_data);
         } catch (ImagickException $e) {
             throw new Horde_Image_Exception($e);
         }
-        $this->_imagick->setFormat($this->_type);
+        $this->_imagick->setImageFormat($this->_type);
+        unset($this->_data);
         $this->_imagick->setIteratorIndex(0);
     }
 
@@ -114,7 +115,7 @@ class Horde_Image_Imagick extends Horde_Image_Base
         } catch (ImagickException $e) {
             throw new Horde_Image_Exception($e);
         }
-        $this->_imagick->setFormat($this->_type);
+        $this->_imagick->setImageFormat($this->_type);
         $this->_imagick->setIteratorIndex(0);
         unset($this->_data);
     }