I am using ImageMagick with the PHP IMagick API to process uploaded jpg files - however, when I try to read a Blob or even read a physical file, I get the exception,
NoDecodeDelegateForThisImageFormat
An example of the code I am using is below -
private function resizeImageBlob($blob, $width, $height) {
$image = new Imagick();
$image->readImageBlob($blob);
$image->resizeImage($width, $height, IMAGICK::FILTER_LANCZOS, 1);
$resizedBlob = $image->getImageBlob();
return $resizedBlob;
}
The image that the blob represents is a jpg image, but ImageMagick throws the exception when it tries to read the line
$image->readImageBlob($blob);
Does anybody know why this might be happening?