Beispiel #1
0
 public function testTrim()
 {
     if (!extension_loaded('imagick')) {
         $this->markTestSkipped('The `imagick` extension is not available.');
     }
     $media = new Image(['source' => "{$this->_files}/image_letterboxed.png", 'adapter' => 'Imagick']);
     $media->trim();
     $temporary = fopen('php://temp', 'w+');
     $media->store($temporary);
     rewind($temporary);
     $media = new ImagickCore();
     $media->readImageFile($temporary);
     $expected = 400;
     $result = $media->getImageWidth();
     $this->assertEquals($expected, $result);
     $expected = 200;
     $result = $media->getImageHeight();
     $this->assertEquals($expected, $result);
 }
Beispiel #2
0
 public function testNormalizeDimensions($width, $height, $recalculateBy = 'ratio')
 {
     return parent::_normalizeDimensions($width, $height, $recalculateBy);
 }