Code: Select all
@rename($szTempFilename, $szNewFilename);
if(MagickReadImage($pImg, $szNewFilename)) //MagickReadImage returns TRUE
{
print_r(MagickGetImageResolution($pImg)); //Array ( [0] => 72 [1] => 72 )
print "\n".MagickGetImageWidth($pImg); //24
print "\n".MagickGetImageHeight($pImg); //24
print "\n".MagickGetImageMimeType($pImg); //image/x-ico
print MagickEchoImageBlob($pImg); //returns fatal error
print $szData = MagickGetImageBlob($pImg); //Nothing returned
$szNewFilename is similar to: 1243232325.ico
The fatal error returned is:
Fatal error: magickechoimageblob(): an unknown error occurred; the image BLOB to be output was empty in /xxx/xxx/xxx/xxx.php on line 338
On another note, how good is ICO detection? I have had to hack in first 4 character hex detection as it wasn't getting picked up!