Imagick::pingImageFile
← pingImage
pingImageFile →
This method can be used to query image width, height, size, and
format without reading the whole image to memory.
This method is available if Imagick has been compiled against ImageMagick version 6.2.9 or newer.
This method can be used to query image width, height, size, and format without reading the whole image in to memory.
For file: Biter_500.jpg
Width is 500
Height is 400
Example
$image = new \Imagick();
$image_data = file_get_contents(realpath($this->imageControl->getImagePath()));
$image->pingImageBlob($image_data);
$output .= "For file: " . basename($this->imageControl->getImagePath()) . " <br/><br/>";
$output .= "Width is " . $image->getImageWidth() . "<br/>";
$output .= "Height is " . $image->getImageHeight() . "<br/>";