PHP Imagick pingImageFile () function


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 ( " " , " 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" ;  
The Height of the image is: 215 pixel The Width of the image is: 604 pixel