destroy() public method

Destroy the image object and the related image file directly.
public destroy ( boolean $file = false ) : void
$file boolean
return void
示例#1
0
 public function testFilters()
 {
     $i = new Imagick(__DIR__ . '/../tmp/test.jpg');
     $i->brightness(50)->contrast(50)->contrast(-50)->hue(180)->saturation(100)->hsb(180, 50, 100)->desaturate()->level(50, 50, 50)->level(-100, 50, 300)->sharpen(10)->blur(10)->blur(10, 0, 0, Imagick::GAUSSIAN_BLUR)->blur(10, 0, 0, Imagick::MOTION_BLUR)->blur(10, 0, 0, Imagick::RADIAL_BLUR)->border(5, 5)->border(5, 5, Imagick::OUTER_BORDER)->overlay(__DIR__ . '/../tmp/test.png')->setOpacity(0.9)->overlay(__DIR__ . '/../tmp/test.png')->colorize(new Rgb(255, 0, 0))->invert()->flip()->flop()->flatten()->paint(10)->posterize(5)->noise()->diffuse(10)->pixelate(10)->skew(new Rgb(255, 0, 0), 10, 10)->swirl(20)->wave(20, 20)->pencil(10, 0, 0);
     $this->assertEquals(640, $i->getWidth());
     $i->destroy();
 }