Bug 206873 - .ico file conversion fails
Summary: .ico file conversion fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ImageMagick
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Norm Murray
QA Contact:
URL:
Whiteboard:
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: 6.2.8.0-4.fc6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-04-05 12:51:35 UTC
Type: ---
Embargoed:


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):
ImageMagick-6.2.8.0-3.fc6

How reproducible:
Always

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
icon.

-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
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-
(Inversion)
		 ReadBlobByte(image));
	     q++;
	   }
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!

Thanks!


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.
Thanks!

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.