Bug 481284 - icns2png fails assertion when extracting large icons
icns2png fails assertion when extracting large icons
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: jasper (Show other bugs)
10
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Rex Dieter
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-23 07:36 EST by Joel Uckelman
Modified: 2009-02-06 00:21 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-02-06 00:21:27 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
a ZIIP archive containing the ICNS file which triggers the problem (152.44 KB, application/zip)
2009-01-23 07:44 EST, Joel Uckelman
no flags Details

  None (edit)
Description Joel Uckelman 2009-01-23 07:36:35 EST
Description of problem:

I have an ICNS file created by Apple's IconComposer. The ICNS file appears to
work properly on Mac OS X. It contains 4-channel icons at 16x16, 32x32,
128x128, 256x256, and 512x512. icns2png is unable to extract all of the icons
from this file.

This is what I get when I use icns2png to list the contents:

[uckelman@scylla 3.1]$ icns2png -l vassal-apple.icns 
----------------------------------------------------
Reading icns family from vassal-apple.icns...
 Icon family type is 'icns'
 Icon family size is 180945 bytes
 Listing icon elements...
  'is32' 16x16 32-bit icon (1024 bytes compressed to 719)
  's8mk' 16x16 8-bit mask (256 bytes)
  'il32' 32x32 32-bit icon (4096 bytes compressed to 2236)
  'l8mk' 32x32 8-bit mask (1024 bytes)
  'it32' 128x128 32-bit icon (65536 bytes compressed to 18266)
  't8mk' 128x128 8-bit mask (16384 bytes)
  'ic08' 256x256 32-bit icon (262144 bytes compressed to 41997)
  'ic09' 512x512 32-bit icon (1048576 bytes compressed to 99979)
libicns: icns_get_image_info_for_type: Unable to parse icon type 'icnV'
  'icnV' 0x0 0-bit (4 bytes)
 9 elements total in vassal-apple.icns.

An assertion fails when I try to extract the images:

[uckelman@scylla 3.1]$ icns2png -x vassal-apple.icns 
----------------------------------------------------
Reading icns family from vassal-apple.icns...
  Saved 'is32' element to vassal-apple_16x16x32.png.
  Saved 'il32' element to vassal-apple_32x32x32.png.
  Saved 'it32' element to vassal-apple_128x128x32.png.
icns2png: jpc_dec.c:1072: jpc_dec_tiledecode: Assertion `dec->numcomps == 3' failed.
Aborted

If I try to extract the images individually, it works for all of them except
the 256x256 and 512x512, which give me this same failed assertion:

[uckelman@scylla 3.1]$ icns2png -s 256 -x vassal-apple.icns 
----------------------------------------------------
Reading icns family from vassal-apple.icns...
icns2png: jpc_dec.c:1072: jpc_dec_tiledecode: Assertion `dec->numcomps == 3' failed.
Aborted
[uckelman@scylla 3.1]$ icns2png -s 512 -x vassal-apple.icns 
----------------------------------------------------
Reading icns family from vassal-apple.icns...
icns2png: jpc_dec.c:1072: jpc_dec_tiledecode: Assertion `dec->numcomps == 3' failed.
Aborted


According to the libicns release notes, it needs to be linked against jasper
or libopenjpeg to handle the largest images sizes, but ldd says that icns2png
is linked agianst libjasper, so I think that's not the problem.



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

libicns-0.6.1-1.fc10.x86_64
libicns-utils-0.6.1-1.fc10.x86_64

How reproducible:

Always.

Steps to Reproduce:
1. icns2png -x vassal-apple.icns

Actual results:

An assertion fails while extracting the 256x256 image.

Expected results:

All images should extract successfully.
Comment 1 Joel Uckelman 2009-01-23 07:44:03 EST
Created attachment 329820 [details]
a ZIIP archive containing the ICNS file which triggers the problem

I had to upload the file inside a ZIP archive because the file itself exposed yet another bug---if I try to select it in Firefox's file chooser, Firefox crashes, which seems to have something to do with the file chooser's attempt to show an image preview of the ICNS file.
Comment 2 Andrea Musuruane 2009-01-23 10:41:03 EST
I have opened an upstream bug for this: SF 2531242

https://sourceforge.net/tracker/index.php?func=detail&aid=2531242&group_id=174339&atid=868840
Comment 3 Mathew Eis 2009-01-24 22:47:45 EST
Hi,

This is due to a bug in the upstream of jasper.

You can see details of the problem and a proposed fix here:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=469786
(As seen, the fix has since been integrated into Debian)

You can also see some discussion on the formal mailing list here:
http://tech.groups.yahoo.com/group/jasper-discussion/message/1774
http://tech.groups.yahoo.com/group/jasper-discussion/message/1831
http://tech.groups.yahoo.com/group/jasper-discussion/message/1832

It sounds as if the fix will be in the next upstream release of
Jasper, but there is no real word on how long it will be until that
takes place...

Let me know if there is are any further problems.

Thank you,

-Mathew Eis
Comment 4 Joel Uckelman 2009-01-25 10:22:57 EST
Would it be possible to get this patch applied to the Fedora build of jasper instead of waiting for it to be fixed upstream? The same bug in jasper also causes Firefox to crash (Bug 481291) which I'd guess counts as a Big Deal, in comparison with icns2png being broken.
Comment 5 Andrea Musuruane 2009-01-25 10:35:43 EST
(In reply to comment #4)
> Would it be possible to get this patch applied to the Fedora build of jasper
> instead of waiting for it to be fixed upstream? The same bug in jasper also
> causes Firefox to crash (Bug 481291) which I'd guess counts as a Big Deal, in
> comparison with icns2png being broken.

Reassigning this bug to jasper. I think this is the quickest way to have this fixed.
Comment 6 Rex Dieter 2009-01-25 11:04:18 EST
Sure, I'll take a look.
Comment 7 Rex Dieter 2009-01-25 11:34:28 EST
Try out:
https://admin.fedoraproject.org/updates/jasper-1.900.1-9.fc10
Comment 8 Joel Uckelman 2009-01-25 11:49:28 EST
(In reply to comment #7)
> Try out:
> https://admin.fedoraproject.org/updates/jasper-1.900.1-9.fc10

I can extract the large icons successfully with this build of jasper. This appears to fix the bug.
Comment 9 Fedora Update System 2009-01-26 20:49:49 EST
jasper-1.900.1-9.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update jasper'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-0986
Comment 10 Fedora Update System 2009-02-06 00:19:44 EST
jasper-1.900.1-9.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 Fedora Update System 2009-02-06 00:21:21 EST
jasper-1.900.1-9.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

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