Exemplo n.º 1
0
 public function testFilterConvolutionBlur()
 {
     $file = 'tests/generated/filter/filter-convolution-blur.jpeg';
     if (file_exists($file)) {
         unlink($file);
     }
     $matrix = array(array(1.0, 2.0, 1.0), array(2.0, 4.0, 2.0), array(1.0, 2.0, 1.0));
     $image = new Image('tests/carlos.jpeg');
     $image->addFilter(new Filter\Convolution($matrix, 16, 0));
     $image->generate(new Format\JPEG(), $file);
     $this->assertEquals(true, file_exists($file));
 }
Exemplo n.º 2
0
 public function testTransformationMultipleRotate()
 {
     $image = new Image('tests/carlos.jpeg');
     $image->addTransformation(new \Paint\Transformation\Rotate(90));
     $image->addTransformation(new \Paint\Transformation\Rotate(90));
     $image->addTransformation(new \Paint\Transformation\Rotate(180));
     $image->addTransformation(new \Paint\Transformation\Rotate(180));
     $image->addTransformation(new \Paint\Transformation\Rotate(270));
     $image->addTransformation(new \Paint\Transformation\Rotate(270));
     $image->generate(new \Paint\Format\JPEG(), 'tests/generated/output_multi_rotated.jpg');
 }
Exemplo n.º 3
0
 public function testGenerateXBM()
 {
     if (!function_exists('imagexbm')) {
         $this->setExpectedException('Paint\\Exception\\CapabilityException');
     }
     $file = 'tests/generated/output.xbm';
     if (file_exists($file)) {
         unlink($file);
     }
     $image = new Image('tests/carlos.jpeg');
     $image->generate(new Format\XBM(), $file);
     $this->assertEquals(true, file_exists($file));
 }