public function testSaveFailureUnknownMimeType() { $srcPath = $this->testFiles['jpeg']; $dstPath = $this->getTempPath(); $handler = new ezcImageGdHandler(ezcImageGdHandler::defaultSettings()); $ref = $handler->load($srcPath); try { $handler->save($ref, $dstPath, 'text/plain'); $this->fail('Exception not thrown on save with invalid MIME type.'); } catch (ezcImageMimeTypeUnsupportedException $e) { } $handler->close($ref); }
public function testSaveNewfileCompressionHigh() { $srcPath = $this->testFiles["png"]; $dstPath = $this->getTempPath(); $handler = new ezcImageGdHandler(ezcImageGdHandler::defaultSettings()); $ref = $handler->load($srcPath); $opts = new ezcImageSaveOptions(); $opts->compression = 9; $handler->save($ref, $dstPath, "image/png", $opts); $this->assertTrue(filesize($dstPath) < 40000, "File saved with too low compression."); }