From 81943fdafd23db3c762d995ff832d6541b45fe67 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sat, 20 Feb 2010 15:34:47 -0500 Subject: [PATCH] Add test for the now fixed issue of not correctly setting the image's mime type --- framework/Image/tests/im.php | 18 +++++++++++++++--- framework/Image/tests/runtest.php | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/framework/Image/tests/im.php b/framework/Image/tests/im.php index b0a21262a..a9425c31e 100644 --- a/framework/Image/tests/im.php +++ b/framework/Image/tests/im.php @@ -227,8 +227,7 @@ case 'testRoundCornersDropShadowYellowBG': case 'testBorderedDropShadowTransparentBG': $time = xdebug_time_index(); - $image = getImageObject(array('filename' => 'img1.jpg', - 'background' => 'none')); + $image = getImageObject(array('filename' => 'img1.jpg')); $image->resize(150,150, true); $image->addEffect('Border', array('bordercolor' => '#333', 'borderwidth' => 1)); $image->addEffect('DropShadow', @@ -242,6 +241,20 @@ case 'testBorderedDropShadowTransparentBG': logThis($test, $time, $memory); break; +case 'testBorderedDropShadowTransparentLoadString': + $image = getImageObject(); + $data = file_get_contents('img1.jpg'); + $image->loadString($data); + $image->resize(150,150, true); + $image->addEffect('Border', array('bordercolor' => '#333', 'borderwidth' => 1)); + $image->addEffect('DropShadow', + array('background' => 'none', + 'padding' => 5, + 'distance' => 8, + 'fade' => 2)); + $image->display(); + break; + case 'testBorderedDropShadowBlueBG': $time = xdebug_time_index(); $image = getImageObject(array('filename' => 'img1.jpg', @@ -426,7 +439,6 @@ function getImageObject($params = array()) { global $conf; - // Always pass the convert parameter to be consistent when profiling. $context = array('tmpdir' => Horde::getTempDir(), 'convert' => $GLOBALS['convert'], 'logger' => $GLOBALS['logger'], diff --git a/framework/Image/tests/runtest.php b/framework/Image/tests/runtest.php index e586558f2..69b712930 100644 --- a/framework/Image/tests/runtest.php +++ b/framework/Image/tests/runtest.php @@ -18,6 +18,7 @@ $allTests = array( 'testRoundCornersDropShadowTransparentBG' => 'Rounded corners with a drop shadow on a transparent background.', 'testRoundCornersDropShadowYellowBG' => 'Rounded corners, with a drop shadow on a yellow background', 'testBorderedDropShadowTransparentBG' => 'Thumbnail with border and drop shadow over a transparent background.', + 'testBorderedDropShadowTransparentLoadString' => 'Same as above, but using loadString after the image has been instantiated.', 'testBorderedDropShadowBlueBG' => 'Thumbnail with border, drop shadow over a blue background.', 'testPolaroidTransparentBG' => 'Polaroid effect with transparent background.', 'testPolaroidBlueBG' => 'Polaroid effect with blue background.', -- 2.11.0