GNOME Bugzilla – Bug 674724
ico files are limited to 255 x 255 when they should be 256 x 256
Last modified: 2014-10-26 11:14:06 UTC
In the Pinta project we fixed a crash when users tried to save images larger than 256 x 256 as .ico files via gdk-pixbuf, but then when I checked the gdk-pixbuf source code to make sure [1] it turned out that the limit is set to 255 x 255. Now, I know from [2] and [3] that classic .ico files can be 256 x 256 pixels. However, it appears that 256 x 256 is supposed to be stored as 0 x 0 , and this is where gdk-pixbuf goes wrong by throwing an error when a file is 256 x 256 pixels. It should instead store the file and write 0 x 0 in the header. [1]: http://git.gnome.org/browse/gdk-pixbuf/tree/gdk-pixbuf/io-ico.c#n998 [2]: http://msdn.microsoft.com/en-us/library/aa511280.aspx [3]: https://en.wikipedia.org/wiki/ICO_%28file_format%29
Do you have a 256x256 example file that we could use for testing? (we can test loading 256x256 files, and then check that we can load the 256x256 file that we saved ourselves)
commit 3997cbb736ec67dd1b5a4205ab7aea3d5aecae1f Author: Bastien Nocera <hadess@hadess.net> Date: Fri Oct 24 15:19:49 2014 +0200 ico: Fix support for 256x256 icons In both loading and saving them. The ico format uses "0" as the width or height to mean 256: https://en.wikipedia.org/wiki/ICO_%28file_format%29#Icon_resource_structure Also add a test for that. https://bugzilla.gnome.org/show_bug.cgi?id=674724
Hi, sorry I didn't get back to you in time (I was up a mountain), but didn't have any particular 256 x 256 file to test with. Any 256px file would be fine though, so I believe your approach is entirely correct. Thanks for fixing it!