IM-6.7.8-3 fails to PNG-encode ICO files

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
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

IM-6.7.8-3 fails to PNG-encode ICO files

Post by glennrp »

PNG-encoding of ICO files does not work in IM-6.7.8-3 because of a bug that causes coders/icon.c to never use PNG encoding (at line 854, both "> 256L" should be ">= 256L"). Also, we need to ensure that we only write png32-formatted PNGs inside an ICO, according to http://msdn.microsoft.com/en-us/library/aa511280.aspx (otherwise at least Fiirefox will reject them). That can be accomplished by setting the png:format=png32 artifact in icon.c; the png encoder will read this artifact and write a PNG32.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: IM-6.7.8-3 fails to PNG-encode ICO files

Post by glennrp »

I have checked in a fix to IM-6.7.8-4 (SVN revision 8691) and IM-7.0.0 (SVN revision 8692). When the subimage dimensions are 256x256, "BI_PNG" compression is used, with the subimage encoded in PNG32 format (32-bit RGBA PNG pixels), only if image->compression is UndefinedCompression or ZipCompression.
Post Reply