Esempio n. 1
0
 public function save($handle, $uri = null)
 {
     if ($uri == null) {
         return de77\BMP::imagebmp($handle);
     }
     return de77\BMP::imagebmp($handle, $uri);
 }
 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);
 }
 /**
  * @expectedException WideImage\Exception\Exception
  */
 public function testSaveToStringNotSupported()
 {
     $handle = de77\BMP::imagecreatefrombmp(IMG_PATH . 'splat.tga');
     $this->mapper->save($handle);
 }