|
@@ 232-241 (lines=10) @@
|
| 229 |
|
* @test |
| 230 |
|
* @covers ::resize |
| 231 |
|
*/ |
| 232 |
|
public function resizeWithColorOfBlur() |
| 233 |
|
{ |
| 234 |
|
$source = new \Imagick(); |
| 235 |
|
$source->readImage(__DIR__ . '/_files/portrait.jpg'); |
| 236 |
|
$actual = Image::resize($source, 1024, 768, ['upsize' => true, 'bestfit' => false, 'color' => 'blur']); |
| 237 |
|
$expected = new \Imagick(); |
| 238 |
|
$expected->readImage(__DIR__ . '/_files/blur.jpg'); |
| 239 |
|
$comparison = $expected->compareImages($actual, \Imagick::METRIC_UNDEFINED); |
| 240 |
|
$this->assertGreaterThanOrEqual(.99, $comparison[1]); |
| 241 |
|
} |
| 242 |
|
|
| 243 |
|
/** |
| 244 |
|
* @test |
|
@@ 247-257 (lines=11) @@
|
| 244 |
|
* @test |
| 245 |
|
* @covers ::resize |
| 246 |
|
*/ |
| 247 |
|
public function resizeWithBlurBackground() |
| 248 |
|
{ |
| 249 |
|
$source = new \Imagick(); |
| 250 |
|
$source->readImage(__DIR__ . '/_files/portrait.jpg'); |
| 251 |
|
$actual = Image::resize($source, 1024, 768, ['upsize' => true, 'bestfit' => false, 'blurBackground' => true]); |
| 252 |
|
|
| 253 |
|
$expected = new \Imagick(); |
| 254 |
|
$expected->readImage(__DIR__ . '/_files/blur.jpg'); |
| 255 |
|
$comparison = $expected->compareImages($actual, \Imagick::METRIC_UNDEFINED); |
| 256 |
|
$this->assertGreaterThanOrEqual(.99, $comparison[1]); |
| 257 |
|
} |
| 258 |
|
|
| 259 |
|
/** |
| 260 |
|
* @test |
|
@@ 263-274 (lines=12) @@
|
| 260 |
|
* @test |
| 261 |
|
* @covers ::resize |
| 262 |
|
*/ |
| 263 |
|
public function resizeWithBurredBackgroundWithCustomBlurValue() |
| 264 |
|
{ |
| 265 |
|
$source = new \Imagick(); |
| 266 |
|
$source->readImage(__DIR__ . '/_files/portrait.jpg'); |
| 267 |
|
$options = ['upsize' => true, 'bestfit' => false, 'blurBackground' => true, 'blurValue' => 30.0]; |
| 268 |
|
$actual = Image::resize($source, 1024, 768, $options); |
| 269 |
|
|
| 270 |
|
$expected = new \Imagick(); |
| 271 |
|
$expected->readImage(__DIR__ . '/_files/blur-30.jpg'); |
| 272 |
|
$comparison = $expected->compareImages($actual, \Imagick::METRIC_UNDEFINED); |
| 273 |
|
$this->assertGreaterThanOrEqual(.999, $comparison[1]); |
| 274 |
|
} |
| 275 |
|
|
| 276 |
|
/** |
| 277 |
|
* @test |