function save($handle, $uri = null) { if ($uri == null) { return WideImage_vendor_de77_BMP::imagebmp($handle); } else { return WideImage_vendor_de77_BMP::imagebmp($handle, $uri); } }
function testSaveToString() { $handle = WideImage_vendor_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 */ public function testSaveToStringNotSupported() { $handle = WideImage_vendor_de77_BMP::imagecreatefrombmp(IMG_PATH . 'splat.tga'); $this->mapper->save($handle); }