Closed
Bug 108318
Opened 24 years ago
Closed 24 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•24 years ago
|
||
| Assignee | ||
Comment 2•24 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•24 years ago
|
||
| Assignee | ||
Updated•24 years ago
|
Attachment #56440 -
Attachment is obsolete: true
| Assignee | ||
Updated•24 years ago
|
Attachment #56441 -
Attachment is obsolete: true
| Assignee | ||
Comment 5•24 years ago
|
||
| Assignee | ||
Updated•24 years ago
|
Attachment #56449 -
Attachment is obsolete: true
| Assignee | ||
Comment 6•24 years ago
|
||
Comment 7•24 years ago
|
||
Comment on attachment 56454 [details] [diff] [review]
Cleanup.
r=pavlov
Attachment #56454 -
Flags: review+
Comment 8•24 years ago
|
||
Comment on attachment 56454 [details] [diff] [review]
Cleanup.
sr=jst
Attachment #56454 -
Flags: superreview+
| Assignee | ||
Updated•24 years ago
|
Attachment #56454 -
Attachment is obsolete: true
| Assignee | ||
Comment 9•24 years ago
|
||
| Assignee | ||
Updated•24 years ago
|
Attachment #56698 -
Attachment is obsolete: true
| Assignee | ||
Comment 10•24 years ago
|
||
| Assignee | ||
Updated•24 years ago
|
Target Milestone: --- → mozilla0.9.6
Comment 11•24 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•24 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•24 years ago
|
||
strength reduce as darin suggested, and sr=waterson.
| Assignee | ||
Comment 14•24 years ago
|
||
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 15•24 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
•