PHP Imagick pingImageFile () function

PHP

Syntex:
bool Imagick::pingImageFile ($filehandle, $fileName)
Parameters:This function takes two parameters as above and described below:
  • $filehandle:This is a required parameter. It opens a file descriptor to the image.
  • $fileName:This is an optional parameter. It contains the filename for this image.
Return Value:Returns True on success.The program below illustrates the Imagick::pingImageFile function() in PHP:Program :  
// Use the fopen() function to open the file $fp = fopen ( " https://media.engineerforengineer.org/wp-content/uploads/20190707132104/Capture40.jpg " , " rb " );  
// Create a new imagick object $im = new Imagick();  
// Pass the imagick descriptor
// without loading memory $im -> pingImageFile ( $fp );  
// Get the image height echo "The Height of the image is:" . $im -> getImageHeight(). "pixel < br >" ;  
// Get the width of the image echo "The Width of the image is:" . $im -> getImageWidth(). "pixel" ;  
?>
Output:
The Height of the image is: 215 pixel The Width of the image is: 604 pixel
Link: https://php.net/manual/en/imagick.pingimagefile.php