Fail ico support in PHP

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
[DRuG]Slick

Fail ico support in PHP

Post by [DRuG]Slick »

Hi ImageMagick team,

I am using the ImageMagick-6.6.3-1-Q16-windows-dll extension for PHP, everything works perfect except .ico support? I receive this error,
no decode delegate for this image format `C:\Windows\phpA678.tmp' @ error/constitute.c/ReadImage/532 .
This leads me to believe icon files are just unsupported, but they are supposed to be?

Let me know if you need any extra information.

Thanks, Slick
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Fail ico support in PHP

Post by magick »

ImageMagick supports ICO. Assume your ICO file is named image.ico. Does this work from the command line:
  • imdisplay image.ico
If not, post a URL to your ICO image so we can download it and reproduce the problem.
[DRuG]Slick

Re: Fail ico support in PHP

Post by [DRuG]Slick »

Ok here's what I have found, icons do work, but only if their extension is .ico. Where I was receiving the error was during a PHP upload, opening the temporary file named ****.tmp although this is no problem with any other image format.

Is this a limitation of the icon format? Is it possible to detect icons without the extension or will I need to create a workaround in PHP? Thanks again :)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Fail ico support in PHP

Post by magick »

We can only auto detect image formats if there is a unique method to identify an image format. Most image formats have a unique signature, PNG for example has \211PNG\r\n\032\n. Icon images do not appear to have a unique signature so you must provide a hint to ImageMagick such as filenames in these formats: ico:image.tmp or image.ico.
[DRuG]Slick

Re: Fail ico support in PHP

Post by [DRuG]Slick »

Cheers mate! Thanks for the quick responses that works great.
Post Reply