public function testSaveToString()
 {
     $handle = de77\BMP::imagecreatefrombmp(IMG_PATH . 'fgnl.bmp');
     ob_start();
     $this->mapper->save($handle);
     $string = ob_get_clean();
     $this->assertTrue(strlen($string) > 0);
     imagedestroy($handle);
     // string contains valid image data
     $handle = $this->mapper->loadFromString($string);
     $this->assertTrue(WideImage::isValidImageHandle($handle));
     imagedestroy($handle);
 }
Пример #2
0
 public function load($uri)
 {
     return de77\BMP::imagecreatefrombmp($uri);
 }
 /**
  * @expectedException WideImage\Exception\Exception
  */
 public function testSaveToStringNotSupported()
 {
     $handle = de77\BMP::imagecreatefrombmp(IMG_PATH . 'splat.tga');
     $this->mapper->save($handle);
 }