After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 529629 - Windows Icon (.ico) are not saved correctly.
Windows Icon (.ico) are not saved correctly.
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.4.x
Other Mac OS
: Normal normal
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
: 553517 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-04-23 23:19 UTC by Elvenpath
Modified: 2008-10-30 20:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
original favicon.ico from kde3, opens and displays correctly (1.37 KB, application/octet-stream)
2008-07-26 18:56 UTC, Daniel Macks
  Details
"Save a copy" of favicon.ico, cannot be opened or displayed (1.37 KB, application/octet-stream)
2008-07-26 18:58 UTC, Daniel Macks
  Details
ico save endianness handling (728 bytes, patch)
2008-08-13 17:26 UTC, Aurimas Juška
committed Details | Review

Description Elvenpath 2008-04-23 23:19:05 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:
Comment 1 Sven Neumann 2008-04-24 06:24:06 UTC
Please attach a file that shows the problem.
Comment 2 Michael Schumacher 2008-06-26 19:56:24 UTC
Elvenpath, we are waiting for an example file.
Comment 3 Daniel Macks 2008-07-24 12:40:22 UTC
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.
Comment 4 Daniel Macks 2008-07-26 18:55:15 UTC
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).
Comment 5 Daniel Macks 2008-07-26 18:56:53 UTC
Created attachment 115332 [details]
original favicon.ico from kde3, opens and displays correctly
Comment 6 Daniel Macks 2008-07-26 18:58:57 UTC
Created attachment 115333 [details]
"Save a copy" of favicon.ico, cannot be opened or displayed
Comment 7 Aurimas Juška 2008-08-13 17:26:57 UTC
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.
Comment 8 Sven Neumann 2008-08-13 19:07:31 UTC
Please commit this to trunk and to the gimp-2-4 branch.
Comment 9 Daniel Macks 2008-08-15 13:48:33 UTC
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.
Comment 10 Sven Neumann 2008-08-15 17:52:59 UTC
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).
Comment 11 Aurimas Juška 2008-08-17 21:52:43 UTC
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.
Comment 12 Daniel Macks 2008-08-17 23:42:17 UTC
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.
Comment 13 Michael Schumacher 2008-09-24 07:58:47 UTC
*** Bug 553517 has been marked as a duplicate of this bug. ***