Skip to content

Commit ce2153e

Browse files
committed
Blur the resized image, not the original
1 parent fefae6f commit ce2153e

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public static function resize(Imagick $source, int $boxWidth, int $boxHeight, ar
198198
}
199199

200200
//put image in box
201-
$canvas = self::getBackgroundCanvas($source, $color, $blurBackground, $blurValue, $boxWidth, $boxHeight);
201+
$canvas = self::getBackgroundCanvas($clone, $color, $blurBackground, $blurValue, $boxWidth, $boxHeight);
202202
if ($canvas->compositeImage($clone, \Imagick::COMPOSITE_ATOP, $targetX, $targetY) !== true) {
203203
//cumbersome to test
204204
throw new \Exception('Imagick::compositeImage() did not return true');//@codeCoverageIgnore

tests/ImageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public function resizeWithColorOfBlur()
244244
$expected = new \Imagick();
245245
$expected->readImage(__DIR__ . '/_files/blur.jpg');
246246
$comparison = $expected->compareImages($actual, \Imagick::METRIC_UNDEFINED);
247-
$this->assertGreaterThanOrEqual(.999, $comparison[1]);
247+
$this->assertGreaterThanOrEqual(.99, $comparison[1]);
248248
}
249249

250250
/**
@@ -261,7 +261,7 @@ public function resizeWithBlurBackground()
261261
$expected = new \Imagick();
262262
$expected->readImage(__DIR__ . '/_files/blur.jpg');
263263
$comparison = $expected->compareImages($actual, \Imagick::METRIC_UNDEFINED);
264-
$this->assertGreaterThanOrEqual(.999, $comparison[1]);
264+
$this->assertGreaterThanOrEqual(.99, $comparison[1]);
265265
}
266266

267267
/**

tests/_files/blur-30.jpg

318 Bytes
Loading

0 commit comments

Comments
 (0)