public function testImageColorAt() { $image = new Image_Image(); if ($image->gd_support_gif) { $this->assertEquals($image->openImage(TEST_BASE . DIRECTORY_SEPARATOR . "image.gif"), true); //8 bit GIF image $this->assertEquals($image->imageColorAt(3, 3), 255); //Solid blue } $image->destroyImage(); $this->assertNull($image->image); if ($image->gd_support_png) { $this->assertEquals($image->openImage(TEST_BASE . DIRECTORY_SEPARATOR . "image.png"), true); //32 bit PNG image $this->assertEquals($image->imageColorAt(3, 3), 255); //Solid blue } $image->destroyImage(); $this->assertNull($image->image); if ($image->gd_support_jpg) { $this->assertEquals($image->openImage(TEST_BASE . DIRECTORY_SEPARATOR . "image.jpg"), true); //24 bit JPEG image $this->assertEquals($image->imageColorAt(3, 3), 4537); //Solid blue (with jpg compression so it's the wrong color) } $image->destroyImage(); $this->assertNull($image->image); }
public function testSize() { $image = new Image_Image(); $analyser = $image->attach(new Image_Helper_Analyser()); $image->openImage(TEST_BASE . DIRECTORY_SEPARATOR . 'image.png'); $this->assertEquals($image->testImageHandle(), true); $this->assertEquals($image->imagesx(), 100); $this->assertEquals($image->imagesy(), 100); $image->destroyImage(); }