Imagick::contrastImage> <Imagick::compositeImage
Last updated: Fri, 24 Feb 2012

Imagick::__construct

(PECL imagick 2.0.0)

Imagick::__constructThe Imagick constructor

Descrição

Imagick::__construct ( mixed $files )

Creates an Imagick instance for a specified image or set of images.

Parâmetros

files

The path to an image to load or an array of paths. Paths can include wildcards for file names, or can be URLs.

Valor Retornado

Returns a new Imagick object on success.

Erros

Dispara ImagickException em erro.



User Contributed Notes
Imagick::__construct
martin at lks dot com
23-May-2012 01:29
If you are using windows imagemagick, at leat in my case, you have to include the full path of the file, including the 'c:' at the beginning. If you don't know for sure the way that the filename is going to come, you can use realpath() function to normalize it:

<?php
    $incoming_file
= '/Users/John/Desktop/file_loco.jpg';
   
$img = new Imagick(realpath($incoming_file));
   
// realpath() will convert '/Users/John/Desktop/file_loco.jpg' to 'C:\Users\John\Desktop\file_loco.jpg'
    // and ImageMagick will have no trouble when loading
?>

Imagick::contrastImage> <Imagick::compositeImage
Last updated: Fri, 24 Feb 2012