コード例 #1
0
ファイル: ImageSystemTest.php プロジェクト: davidpersson/mm
 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);
 }
コード例 #2
0
ファイル: ImageMock.php プロジェクト: edukondaluetg/mm
 public function testNormalizeDimensions($width, $height, $recalculateBy = 'ratio')
 {
     return parent::_normalizeDimensions($width, $height, $recalculateBy);
 }