Pop\Image\Imagick::destroy PHP Метод

destroy() публичный Метод

Destroy the image object and the related image file directly.
public destroy ( boolean $file = false ) : void
$file boolean
Результат void
    public function destroy($file = false)
    {
        $this->resource->clear();
        $this->resource->destroy();
        // Clear PHP's file status cache.
        clearstatcache();
        // If the $file flag is passed, delete the image file.
        if ($file) {
            $this->delete();
        }
    }

Usage Example

Пример #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();
 }