Bug 206873 - .ico file conversion fails
.ico file conversion fails
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: ImageMagick (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Norm Murray
:
Depends On:
Blocks: 206874
  Show dependency treegraph
 
Reported: 2006-09-17 12:05 EDT by Anthony Green
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 6.2.8.0-4.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-04-05 08:51:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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 12:05 EDT, Anthony Green
no flags Details
Patch: Fix transparancy of 32 bpp .ico files (689 bytes, patch)
2006-11-15 04:13 EST, Sjoerd & Bas
no flags Details | Diff
Patch from upstream (572 bytes, patch)
2007-01-22 09:20 EST, Anthony Green
no flags Details | Diff

  None (edit)
Description Anthony Green 2006-09-17 12:05:55 EDT
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 12:05:59 EDT
Created attachment 136487 [details]
ico file that doesn't convert in rawhide
Comment 2 Sjoerd & Bas 2006-11-15 04:13:25 EST
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 07:10:42 EST
(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 09:20:43 EST
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 10:16:08 EST
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 12:03:22 EST
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 12:09:37 EDT
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 08:51:35 EDT
Sorry for the delay. Got it now

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