Closed Bug 198293 Opened 21 years ago Closed 21 years ago

support alpha channel for .ico images

Categories

(Core :: Graphics: ImageLib, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla1.4beta

People

(Reporter: Biesinger, Assigned: Biesinger)

References

()

Details

Attachments

(2 files, 1 obsolete file)

http://storm.campus.luth.se/kevel/favicon.ico is an image that's supposed to
have an alpha channel. the ico decoder does not support that yet.

e.g. microangelo can be used to create such an image -
ftp://daxim.ath.cx/muangelo.png


I am not aware of a spec for this.
http://msdn.microsoft.com/library/en-us/dnwui/html/msdn_icons.asp?frame=true
says: "Also remember that the AND mask is a monochrome DIB, with a color depth
of 1 bpp." which kinda contradicts the validness of above ico...
looks like one is supposed to just throw away the "AND-Mask" of the .ico and use
the 4th color bit of each pixel (currently ignored by the ico decoder) as the
alpha value, where 0=transparent 255=opaque.
Attached patch patch (obsolete) — Splinter Review
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.4beta
Comment on attachment 119623 [details] [diff] [review]
patch

>-                  if (mBIH.bpp == 32)
>-                    p++; // Padding byte
>+                  if (mBIH.bpp == 32) {
>+                    *alphaPos++ = *p++; // Alpha value
>+                  }
Nit: keep existing brace style :-P
Comment on attachment 119623 [details] [diff] [review]
patch

clearing review request, I found a problem with this patch

neil: thanks, fixed it locally
Attachment #119623 - Flags: review?(paper)
Attached patch patch v2Splinter Review
this should be better
Attachment #119623 - Attachment is obsolete: true
I've looked at the patch, I just need to find time to test it.
Any reason why http://wp.netscape.com/favicon.ico displays correctly on my Linux
build but not in my Win32 nightly? AFAIK they're both 24-bit displays.
neil: because of a bug in the ico decoder :) please file a new bug for that...
the decoder should zero out the r/g/b data when the pixel is transparent. please
don't assign that bug to me, though :)
Sprinkling some keywords because Netscape uses 32-bit favicons.
adt: nsbeta1-
Keywords: nsbeta1nsbeta1-
*** Bug 204340 has been marked as a duplicate of this bug. ***
*** Bug 206801 has been marked as a duplicate of this bug. ***
*** Bug 210397 has been marked as a duplicate of this bug. ***
Christian, do you need an sr for this bug? I can if you want. I'd like to see
this get fixed for thunderbird.
Comment on attachment 119842 [details] [diff] [review]
patch v2

scott: that would be cool. I'll ask tor for review, then.
Attachment #119842 - Flags: superreview?(scott)
Attachment #119842 - Flags: review?(tor)
Attachment #119842 - Flags: review?(paper)
Attachment #119842 - Flags: review?(tor) → review+
Attachment #119842 - Flags: superreview?(scott) → superreview+
checked in - thanks for the reviews
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
*** Bug 214027 has been marked as a duplicate of this bug. ***
Attached image testcase
attaching favicon from url here so it won't get lost
Isn't this fixed already?
(In reply to comment #19)
> Isn't this fixed already?

yes it is. I added the testcase to allow testing further patches to the ico
decoder against previously reported bugs, to make sure not to regress them.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: