Closed Bug 831191 Opened 8 years ago Closed 8 years ago

nsPNGEncoder doesn't understand 16bpp surfaces

Categories

(Core :: ImageLib, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: cjones, Assigned: cjones)

Details

Attachments

(1 file)

This makes using the fantastically useful gfxASurface::Dump*() helpers impossible.

244   // Stride is the padded width of each row, so it better be longer 
245   // (I'm afraid people will not understand what stride means, so
246   // check it well)
247   if ((aInputFormat == INPUT_FORMAT_RGB &&
248       aStride < aWidth * 3) ||
249       ((aInputFormat == INPUT_FORMAT_RGBA ||
250       aInputFormat == INPUT_FORMAT_HOSTARGB) &&
251       aStride < aWidth * 4)) {
252     NS_WARNING("Invalid stride for InitFromData/AddImageFrame");
253     return NS_ERROR_INVALID_ARG;
254   }

Will hack around this for now.
Attached patch HackSplinter Review
Running this up the flagpole and seeing if anyone salutes it.  Don't have time for a real fix.
Attachment #702719 - Flags: review?(joe)
Comment on attachment 702719 [details] [diff] [review]
Hack

Review of attachment 702719 [details] [diff] [review]:
-----------------------------------------------------------------

:(

Can you file a followup bug so we can actually fix this correctly?
Attachment #702719 - Flags: review?(joe) → review+
https://hg.mozilla.org/mozilla-central/rev/ae928c1ca2dc
Assignee: nobody → jones.chris.g
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.