Closed Bug 225083 Opened 21 years ago Closed 21 years ago

moz-icon urls show wrongly

Categories

(Core :: Graphics: ImageLib, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Biesinger, Assigned: neil)

Details

Attachments

(3 files, 2 obsolete files)

build from a few days ago, but with neil's patch for Bug 222694, shows moz-icon://.htm?size=16 urls rather wrongly. I'll attach a screenshot
hm, I should've used a less lossy format than jpeg. anyway, the screenshot doesn't make it much uglyer.
this was with 16bpp (1024x768, nvidia geforce2 ti)
What's going on here is that the icon channel is ignoring the bitfields on 16-bit bitmaps although the icon decoder can't handle them anyway...
Attached patch Rough patch (obsolete) — Splinter Review
I know this patch does no error-checking, but it should be good for testing.
hm, have you tried compiling this patch? I get c:/mozilla/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp(269) : error C2039: 'biHeight' : Is no element of 'tagBITMAPINFO'
simply removing the line with that error and recompiling isn't exactly an improvement
Attached patch Alternative approach (obsolete) — Splinter Review
OK, so this way should ensure that I don't query for strange icon types.
this new patch does fix the bug
Attachment #135145 - Flags: review?(ere)
Comment on attachment 135145 [details] [diff] [review] Alternative approach Change the compression to BI_RGB and add a comment about the required double height. With these changes, r=ere
Attachment #135145 - Flags: review?(ere) → review+
Attached patch Better patchSplinter Review
OK, so this fixes 16-bit and 32-bit displays by forcing them to 24-bit.
Attachment #135090 - Attachment is obsolete: true
Attachment #135145 - Attachment is obsolete: true
Attachment #135184 - Flags: superreview?(mscott)
Attachment #135184 - Flags: review?(ere)
Attachment #135184 - Flags: superreview?(mscott) → superreview+
Sigh... somehow I left out the double height code and comment... if (GetDIBits(hDC, iconInfo.hbmColor, 0, colorInfo.bmiHeader.biHeight, buffer + sizeof(ICONFILEHEADER) + sizeof(ICONENTRY) + colorInfoSize, lpBitmapInfo, DIB_RGB_COLORS)) { + // doubling the height because icons contain two bitmaps + lpBitmapInfo->bmiHeader.biHeight <<= 1;
Attached patch diff -wSplinter Review
Attachment #135184 - Flags: review?(ere) → review+
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: