protected function setUp()
 {
     try {
         $this->handler = new ezcImageGdHandler(ezcImageGdHandler::defaultSettings());
     } catch (Exception $e) {
         $this->markTestSkipped($e->getMessage());
     }
     $this->imageReference = $this->handler->load($this->testFiles["jpeg"]);
 }
Esempio n. 2
0
 public function colorspace($space, $region = null)
 {
     $resource = $this->getActiveResource();
     if ($region) {
         $newResource = $this->region(null, $resource, $region, $space);
     } else {
         parent::colorspace($space);
         return;
     }
     $this->setActiveResource($newResource);
 }
Esempio n. 3
0
 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.");
 }