Author: stunami
Date: 2010-03-21 16:38:02 +0100 (Sun, 21 Mar 2010)
New Revision: 28647

Modified:
   
plugins/sfImageTransformPlugin/trunk/lib/transforms/ImageMagick/sfImageFillImageMagick.class.php
Log:
Adding support for floodFillPaintImage as this has replaced the depricated 
colorFloodfillImage in recent versions.


Modified: 
plugins/sfImageTransformPlugin/trunk/lib/transforms/ImageMagick/sfImageFillImageMagick.class.php
===================================================================
--- 
plugins/sfImageTransformPlugin/trunk/lib/transforms/ImageMagick/sfImageFillImageMagick.class.php
    2010-03-21 15:32:45 UTC (rev 28646)
+++ 
plugins/sfImageTransformPlugin/trunk/lib/transforms/ImageMagick/sfImageFillImageMagick.class.php
    2010-03-21 15:38:02 UTC (rev 28647)
@@ -13,7 +13,7 @@
  *
  * Fills the set area with a color or tile image.
  *
- * @package sfImageTransform
+ * @package sfImageTransform
  * @subpackage transforms
  * @author Stuart Lowes <[email protected]>
  * @version SVN: $Id$
@@ -220,13 +220,25 @@
     $resource = $image->getAdapter()->getHolder();
 
     $fill = new ImagickPixel();
-    $fill->setColor($this->fill);
+    $fill->setColor($this->fill);
 
-    $border = new ImagickPixel();
-    $border->setColor($this->border);
+    /*
+     *  colorFloodfillImage has been depricated, use new method is available
+     */
+    if(method_exists($resource, 'floodFillPaintImage') && 
is_null($this->border))
+    {
+      $target = $resource->getImagePixelColor($this->getX(), $this->getY());
+      $resource->floodFillPaintImage($fill, $this->getFuzz(), $target, 
$this->getX(), $this->getY(), false);
+    }
 
-    $resource->colorFloodfillImage($fill, $this->fuzz, $border, $this->x, 
$this->y);
+    else
+    {
+      $border = new ImagickPixel();
+      $border->setColor($this->border);
 
+      $resource->colorFloodfillImage($fill, $this->getFuzz(), $border, 
$this->getX(), $this->getY());
+    }
+
     return $image;
   }
 }

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to