This method can be used to query image width, height, size, and format without reading the whole image in to memory.
$image = new \Imagick(); $image->pingImage(realpath($this->imageControl->getImagePath())); $output .= "For file: " . basename($this->imageControl->getImagePath()) . " <br/><br/>"; $output .= "Width is " . $image->getImageWidth() . "<br/>"; $output .= "Height is " . $image->getImageHeight() . "<br/>";