Imagick::pingImageFile
PHP function
Edit on GitHub ✎
(PECL imagick 2, PECL imagick 3)
Get basic image attributes in a lightweight manner
Description
Imagick::pingImageFile(resource $filehandle, [string $fileName]): bool
This method can be used to query image width, height, size, and format without reading the whole image to memory. 0x629
Parameters
filehandleAn open filehandle to the image.
fileNameOptional filename for this image.
Return Values
Success
Examples
Using Imagick::pingImageFile()
Opening a remote location
php
<?php
/* fopen a remote location */
$fp = fopen("http://example.com/test.jpg");
/* create new imagick object */
$im = new Imagick();
/* pass the handle to imagick */
$im->pingImageFile($fp);
?>