Rubblewebs

THESE CODES ARE PROVIDED FOR AN EXAMPLE OF HOW TO USE IMAGEMAGICK WITH PHP. CARE SHOULD BE TAKEN WHEN ACCEPTING USER INPUT.

I TAKE NO RESPONSABILTY FOR ANY PROBLEMS THAT MAY OCCURE WHEN USING ANY OF THIS CODE.

IT IS UP TO YOU TO SECURE THE CODE AND VALIDATE USER INPUT.

Imagick Functions page: 11

Get image width

Returns the image width.

Image width = 200

$im = new Imagick($input);
$width = $im->getImageWidth();
echo "
Image width = $width";

Get images blob

Implements direct to memory image formats.


( It returns all image sequences as a string. The format of the image determines the format of the returned blob (GIF, JPEG, PNG, etc.). To return a different image format, use Imagick::setImageFormat(). )

Get interlace scheme

Gets the object interlace scheme.

Image interlace scheme = 1

$im = new Imagick($input);
$interlace = $im->getInterlaceScheme();
echo "
Image interlace scheme = $interlace";

Get iterator index

Returns the index of the current active image within the Imagick object.

Get number images

Returns the number of images associated with Imagick object.

Get option

Returns a value associated within the object for the specified key.

Get package name

Returns the ImageMagick package name.

Get page

Returns the page geometry associated with the Imagick object


( In an associative array with the keys "width", "height", "x", and "y". )

Get pixel iterator

Returns a MagickPixelIterator.

Get pixel region iterator

Get an ImagickPixelIterator for an image section.

Get point size

Returns the objects point size property.

Get quantum depth

Returns the Imagick quantum depth as a string.

Long = 16 String = Q16

$im = new Imagick();
$im->readImage($input);
$quantumdepth = $im->getQuantumDepth();
echo "Long = ".$quantumdepth['quantumDepthLong']." String = ".$quantumdepth['quantumDepthString']."
";

Get quantum range

Returns the Imagick quantum range as a string.

Long = 65535 String = 65535

$im = new Imagick();
$im->readImage($input);
$quantumrange = $im->getquantumrange();
echo "Long = ".$quantumrange['quantumRangeLong']." String = ".$quantumrange['quantumRangeString']."
";

Get release date

Returns the ImageMagick release date as a string.