Bug 206873 - .ico file conversion fails
Summary: .ico file conversion fails
Alias: None
Product: Fedora
Classification: Fedora
Component: ImageMagick   
(Show other bugs)
Version: 6
Hardware: All Linux
Target Milestone: ---
Assignee: Norm Murray
QA Contact:
Depends On:
Blocks: 206874
TreeView+ depends on / blocked
Reported: 2006-09-17 16:05 UTC by Anthony Green
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-04-05 12:51:35 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
ico file that doesn't convert in rawhide (9.44 KB, image/x-ico)
2006-09-17 16:05 UTC, Anthony Green
no flags Details
Patch: Fix transparancy of 32 bpp .ico files (689 bytes, patch)
2006-11-15 09:13 UTC, Sjoerd & Bas
no flags Details | Diff
Patch from upstream (572 bytes, patch)
2007-01-22 14:20 UTC, Anthony Green
no flags Details | Diff

Description Anthony Green 2006-09-17 16:05:55 UTC
Description of problem:
The zynaddsubfx package in Extras uses "convert" to turn a .ico file into a .png
file like so....
$ convert -resize 32x32 zynaddsubfx_ico.ico zynaddsubfx-32.png
This works well in FC5.
In FC6 I get a transparent or empty 32x32 png image.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Get the attached .ico file
2.Run "convert -resize 32x32 zynaddsubfx_ico.ico zynaddsubfx-32.png"
3.Look at the resulting png file with the gimp or similar
Actual results:

Expected results:

Additional info:

Comment 1 Anthony Green 2006-09-17 16:05:59 UTC
Created attachment 136487 [details]
ico file that doesn't convert in rawhide

Comment 2 Sjoerd & Bas 2006-11-15 09:13:25 UTC
Created attachment 141240 [details]
Patch: Fix transparancy of 32 bpp .ico files

Inverted transparancy and tested it with several icons, inculding the posted

diff -ur ImageMagick-6.2.8/coders/icon.c ImageMagick-6.2.8-new/coders/icon.c
--- ImageMagick-6.2.8/coders/icon.c	2006-04-15 04:22:23.000000000 +0200
+++ ImageMagick-6.2.8-new/coders/icon.c 2006-11-15 08:44:56.000000000 +0100
@@ -479,7 +479,7 @@
	     q->green=ScaleCharToQuantum((unsigned char) ReadBlobByte(image));
	     q->red=ScaleCharToQuantum((unsigned char) ReadBlobByte(image));
	     if (image->matte != MagickFalse)
-	       q->opacity=ScaleCharToQuantum((unsigned char)
+	       q->opacity=ScaleCharToQuantum(255-(unsigned char) //Added 255-
Only in ImageMagick-6.2.8-new/coders: icon.c~

Comment 3 Anthony Green 2007-01-22 12:10:42 UTC
(In reply to comment #2)
> Created an attachment (id=141240) [edit]
> Patch: Fix transparancy of 32 bpp .ico files

This fixes it!


Comment 4 Anthony Green 2007-01-22 14:20:43 UTC
Created attachment 146180 [details]
Patch from upstream

I checked the latest upstream sources and they use a slightly different patch. 
I don't understand the difference between these patches, but we should probably
go with upstream.

Norm - could you please apply this and respin ImageMagick?  We need this to fix
other packages with bad icons.	Thanks!

Comment 5 Hans de Goede 2007-01-22 15:16:08 UTC
There doesn't seem to be any actual difference between the 2 patches, just 2
different ways of doing the same :) So applying upstream's version should be fine.

Comment 6 Anthony Green 2007-02-23 17:03:22 UTC
Norm - are you planning on addressing this for F7?  I'd like to know if I need
to put a work-around in my ZynAddSubFx package instead of waiting for a fixed
ImageMagick.   That being said, I hope this does get fixed so Hans' students
efforts were not in vain.  I don't mean to needle you about this, but we've
known what the fix is for about a month now.

Comment 7 Anthony Green 2007-03-15 16:09:37 UTC
The new ImageMagick in rawhide fixes this problem, and I've built a new
ZynAddSubFX package with a visible icon, however this is still a problem for FC6.

Norm - we haven't heard from you yet.  Do you plan on applying the patch to
FC6's ImageMagick?

Comment 8 Norm Murray 2007-04-05 12:51:35 UTC
Sorry for the delay. Got it now

Note You need to log in before you can comment on or make changes to this bug.