Only iterate over images once
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 29 May 2009 17:39:45 +0000 (13:39 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 29 May 2009 17:43:21 +0000 (13:43 -0400)
framework/Image/lib/Horde/Image/Effect/Im/PhotoStack.php

index baafc89..c0e1543 100644 (file)
@@ -76,13 +76,11 @@ class Horde_Image_Effect_Im_PhotoStack extends Horde_Image_Effect
                                                        $this->_params['resize_height'],
                                                        true);
             $size = $this->_params['images'][$cnt - 1]->getDimensions();
-            for ($i = 0; $i < $cnt; $i++) {
-                $this->_params['images'][$i]->resize($size['height'], $size['width'], false);
-            }
             $xo = $yo = (count($this->_params['images'])) * $this->_params['offset'];
             $ops = '';
             $haveBottom = false;
             foreach ($this->_params['images'] as $image) {
+                $image->resize($size['height'], $size['width'], false);
                 $xo -= $this->_params['offset'];
                 $yo -= $this->_params['offset'];