HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

Imagick::pingImageFile

← pingImageBlob   polaroidImage →
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: https://phpimagick.com//images/Biter_500.jpg

Width is 500
Height is 400

Example

$image = new \Imagick();
$img_url = "https://phpimagick.com/" . normalisePublicFilePath($this->imageControl->getImagePath());
$fp = fopen($img_url, 'rb');
$image->pingImageFile($fp);
$output .= "For file: " . $img_url . " <br/><br/>";
$output .= "Width is " . $image->getImageWidth() . "<br/>";
$output .= "Height is " . $image->getImageHeight() . "<br/>";