Closed Bug 400603 Opened 18 years ago Closed 18 years ago

Last row of bottom-up bitmap is never updated

Categories

(Core :: Graphics: ImageLib, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: neil, Assigned: neil)

References

Details

(Keywords: regression)

Attachments

(3 files)

The rect that nsBMPDecoder::ProcessData updates is off by one pixel in the bottom-up case. In the top-down case it appears to be completely wrong.
Attached image Testcase
Attached image Testcase
Attachment #285653 - Attachment mime type: application/octet-stream → image/bmp
Attached patch Proposed patchSplinter Review
In the bottom-up case mCurLine is simply the index of the last fully decoded line, so we use it as the top of the rectangle (mOldLine is effectively the bottom of the rectangle, whose height is of course mOldLine - mCurLine). The top-down case is slightly different because of the y-axis reflection. Not only do the top and bottom have to be subtracted from the height, but they also have to be exchanged since the bottom (which was mOldLine) is now the top. I also fixed an abuse of PR_FALSE as an nsresult.
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #285657 - Flags: superreview?(tor)
Attachment #285657 - Flags: review?(pavlov)
Flags: blocking1.9?
Flags: wanted1.9+
Flags: blocking1.9?
Flags: blocking1.9-
Attachment #285657 - Flags: review?(pavlov) → review+
Attachment #285657 - Flags: superreview?(tor) → superreview+
Comment on attachment 285657 [details] [diff] [review] Proposed patch Regression fix, but presumably not M9 urgent, due to the comparative infrequency of bitmaps on the web.
Attachment #285657 - Flags: approval1.9?
Attachment #285657 - Flags: approval1.9? → approval1.9+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 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: