GNOME Bugzilla – Bug 529629
Windows Icon (.ico) are not saved correctly.
Last modified: 2008-10-30 20:12:37 UTC
Please describe the problem: Under Mac OSX (PPC!) and the X-Windows System, it is not possible to save a favicon (Windows Icon format). The format of the saved file is wrong, or the file is damaged. Steps to reproduce: 1. Load a favicon into GIMP 2. Save the favicon. 3. Load the saved favicon. Actual results: You get an empty 16x16 Document. Apples Preview can't even load it. Expected results: The favicon is saved correctly an can be used on websites. Under Linux and Mac OSX with Intel it works perfectly. Does this happen every time? Yes Other information:
Please attach a file that shows the problem.
Elvenpath, we are waiting for an example file.
fink just got gimp-2.4.5, so once I finish compiling it on my OS X 10.4/ppc I can try to reproduce.
Okay, using gimp-2.4.5 with gtk+-2.12.10 and other supporting libraries at the level of gnome2.20, all built for x11 via fink on my OS X 10.4/ppc, I can reproduce this problem. My test file was share/doc/kde/en/common/favicon.ico from kdelibs3 (3.5.9). `file` reports "ms-windows icon resource - 1 icon" and ImageMagick's "display" program (6.4.1 from fink) and Apple's Preview.app open and display it correctly. Open it in gimp. The title bar says it is a "RGB, 1 layer" 16x16 image. Edit it, 'save as', enter a file-name (keeping ".ico" extension). A "Save as Windows Icon" window appears, with icon details "8bpp, 1-bit alpha, 256-slot palette" in the pulldown menu and then has an unchecked item "Compressed (PNG)". `file` still reports the same info and the file-size is still the same, but now neither "display" nor Preview.app can open it. Both report that the file is corrupted. If I close the file in gimp and try to re-open it, I get a 16x16 image that is blank ("RGB-empty, 0 layers" in the title bar).
Created attachment 115332 [details] original favicon.ico from kde3, opens and displays correctly
Created attachment 115333 [details] "Save a copy" of favicon.ico, cannot be opened or displayed
Created attachment 116510 [details] [review] ico save endianness handling The problem seems to be on big endian systems. The patch should be tested on such system. Also, it would be good to test ico save with more complex icons than attached to bug to check if there are more similar issues.
Please commit this to trunk and to the gimp-2-4 branch.
Applied to 2.4.5 (to plug-ins/winicon/icosave.c) and it works now. If you have a complex file for me to try, I'd be happy to experiment further.
Committed to trunk and gimp-2-4. Closing as FIXED: 2008-08-15 Sven Neumann <sven@gimp.org> * plug-ins/file-ico/ico-save.c: applied patch from Aurimas Juška that fixes an endianness issue (bug #529629).
dmacks, you could test any vista icon, for example: http://www.axialis.com/tutorials/iw/down.ico Sven, sorry for not responding, I didn't see any further comments because Bugzilla doesn't add to CC when creating attachment.
2.4.5+patch opens that file fine, edit+save, and can still re-open it. Notably, imagemagick-6.4.1 can't even deal with the original ("Improper image header `/tmp/down.ico'"), I assume due to the layers or some other modern feature, but gimp is fine.
*** Bug 553517 has been marked as a duplicate of this bug. ***