Closed
Bug 108318
Opened 23 years ago
Closed 23 years ago
Make ICO decoder non-incremental
Categories
(Core :: Graphics: ImageLib, defect)
Tracking
()
RESOLVED
FIXED
mozilla0.9.6
People
(Reporter: hyatt, Assigned: hyatt)
Details
Attachments
(1 file, 5 obsolete files)
6.91 KB,
patch
|
pavlov
:
review+
|
Details | Diff | Splinter Review |
This bug is tracking adjusting the ICO decoder to be non-incremental (since
being incremental on a 16x16 icon is rather pointless anyway) and is also
tracking ensuring that the alpha info is set first.
Assignee | ||
Comment 1•23 years ago
|
||
Assignee | ||
Comment 2•23 years ago
|
||
This patch stops using the bitmap info header width/height fields in favor of
the icon dir entry width/height fields. What I'm seeing with some favicons on
the net is that the width/height fields are sometimes garbage in the bitmap
info header. It appears that they're relying on the decoder only using the
icon dir entry width/height. While I'm sure the ico files are technically
malformed, this makes the ICO decoder more robust in that it can successfully
view those files.
Assignee | ||
Comment 4•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #56440 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #56441 -
Attachment is obsolete: true
Assignee | ||
Comment 5•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #56449 -
Attachment is obsolete: true
Assignee | ||
Comment 6•23 years ago
|
||
Comment 7•23 years ago
|
||
Comment on attachment 56454 [details] [diff] [review]
Cleanup.
r=pavlov
Attachment #56454 -
Flags: review+
Comment 8•23 years ago
|
||
Comment on attachment 56454 [details] [diff] [review]
Cleanup.
sr=jst
Attachment #56454 -
Flags: superreview+
Assignee | ||
Updated•23 years ago
|
Attachment #56454 -
Attachment is obsolete: true
Assignee | ||
Comment 9•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #56698 -
Attachment is obsolete: true
Assignee | ||
Comment 10•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Target Milestone: --- → mozilla0.9.6
Comment 11•23 years ago
|
||
Comment on attachment 56699 [details] [diff] [review]
Non-incremental decoder, sets alpha before image data.
r=pavlov
Attachment #56699 -
Flags: review+
Comment 12•23 years ago
|
||
Comment on attachment 56699 [details] [diff] [review]
Non-incremental decoder, sets alpha before image data.
>Index: decoders/bmp/nsICODecoder.cpp
>+ mFrame->GetImageBytesPerRow(&bpr);
>+ for (PRUint32 i = 0; i < mDirEntry.mHeight; i++) {
>+ PRUint32 offset = bpr*i;
>+ mFrame->SetImageData(mDecodedBuffer+offset, bpr, offset);
>+ }
how about this instead:
for (PRUint32 offset = 0, i = 0; i < mDirEntry.mHeight; ++i, offset += bpr)
mFrame->SetImageData(mDecodedBuffer + offset, bpr, offset);
>+ for (PRUint32 i = 0; i < mDirEntry.mHeight; i++) {
>+ PRUint32 offset = bpr*i;
>+ mFrame->SetAlphaData(mAlphaBuffer+offset, bpr, offset);
>+ }
likewise, here.
Comment 13•23 years ago
|
||
strength reduce as darin suggested, and sr=waterson.
Assignee | ||
Comment 14•23 years ago
|
||
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 15•23 years ago
|
||
If reduction in strength is appropriate, why not also eliminate the induction
variable (i)?
for (PRUint32 offset = 0, limit = mDirEntry.mHeight * bpr;
offset < limit;
offset += bpr)
mFrame->SetImageData(mDecodedBuffer + offset, bpr, offset);
/be
You need to log in
before you can comment on or make changes to this bug.
Description
•