Page 1 of 1

Fail ico support in PHP

Posted: 2010-08-01T03:05:40-07:00
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

Re: Fail ico support in PHP

Posted: 2010-08-01T08:13:46-07:00
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.

Re: Fail ico support in PHP

Posted: 2010-08-01T13:47:12-07:00
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 :)

Re: Fail ico support in PHP

Posted: 2010-08-01T13:59:28-07:00
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.

Re: Fail ico support in PHP

Posted: 2010-08-02T00:31:56-07:00
by [DRuG]Slick
Cheers mate! Thanks for the quick responses that works great.