From 3dd7c1e8f8ce82225c90cfd4d2a60ff9ec2787d7 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Fri, 29 May 2009 13:23:23 -0400 Subject: [PATCH] Fix drop shadows for Im photo stacks and fix off by one image offset --- framework/Image/lib/Horde/Image/Effect/Im/PhotoStack.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/framework/Image/lib/Horde/Image/Effect/Im/PhotoStack.php b/framework/Image/lib/Horde/Image/Effect/Im/PhotoStack.php index 1f2b8f8fc..baafc8985 100644 --- a/framework/Image/lib/Horde/Image/Effect/Im/PhotoStack.php +++ b/framework/Image/lib/Horde/Image/Effect/Im/PhotoStack.php @@ -76,11 +76,10 @@ class Horde_Image_Effect_Im_PhotoStack extends Horde_Image_Effect $this->_params['resize_height'], true); $size = $this->_params['images'][$cnt - 1]->getDimensions(); - //$this->_image->resize(2 * $this->_params['resize_height'], 2 * $this->_params['resize_height']); for ($i = 0; $i < $cnt; $i++) { $this->_params['images'][$i]->resize($size['height'], $size['width'], false); } - $xo = $yo = (count($this->_params['images']) + 1) * $this->_params['offset']; + $xo = $yo = (count($this->_params['images'])) * $this->_params['offset']; $ops = ''; $haveBottom = false; foreach ($this->_params['images'] as $image) { @@ -93,7 +92,7 @@ class Horde_Image_Effect_Im_PhotoStack extends Horde_Image_Effect $temp = $image->toFile(); } $this->_image->addFileToClean($temp); - $ops .= ' \( ' . $temp . ' -background none -thumbnail ' . $size['width'] . 'x' . $size['height'] . '! -repage +' . $xo . '+' . $yo . ($this->_params['type'] == 'plain' ? ' -bordercolor "#333" -border 1 ' : ' ' ) . ((!$haveBottom) ? '\( +clone -shadow 80x4+0+0 \) +swap -mosaic' : '') . ' \) '; + $ops .= ' \( ' . $temp . ' -background none -thumbnail ' . $size['width'] . 'x' . $size['height'] . '! -repage +' . $xo . '+' . $yo . ($this->_params['type'] == 'plain' ? ' -bordercolor "#333" -border 1 ' : ' ' ) . ((!$haveBottom) ? '\( +clone -shadow 80x3+4+4 \) +swap -mosaic' : '') . ' \) '; $haveBottom = true; } @@ -101,7 +100,6 @@ class Horde_Image_Effect_Im_PhotoStack extends Horde_Image_Effect // convert versions before 6.4 it seems. Without it specified as // none here, all stacks come out with a white background. $this->_image->addPostSrcOperation($ops . ' -background ' . $this->_params['background'] . ' -mosaic -bordercolor ' . $this->_params['background'] . ' -border ' . $this->_params['padding']); - break; case 'polaroid': -- 2.11.0