Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1464)

Issue 3446042: Review: fix JPEG RGBA->RGB conversion (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 4 months ago by larrygritz
Modified:
13 years, 4 months ago
Reviewers:
Chris Foster, oiio-dev
Base URL:
http://svn.openimageio.org/oiio/trunk/
Visibility:
Public.

Description

Fix the JPEGOutput's implicit RGBA->RGB conversion. We were getting all the strides wrong before and botching the output. Background info: Most format writers would consider it an error for the caller to request writing more color channels than can be supported by the file format. But as a special case, we let the JPEG writer silently drop the alpha channel and write as RGB. The justification is that it's simply too common to deal with RGBA images, very unusual for a format to not support it at all, and too frustrating to users to treat it as an error.

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -2 lines) Patch
src/jpeg.imageio/jpegoutput.cpp View 3 chunks +17 lines, -2 lines 1 comment Download

Messages

Total messages: 4
larrygritz
13 years, 4 months ago (2010-12-04 05:44:38 UTC) #1
Chris Foster
Maybe I need to write an image input or output myself to understand what's going ...
13 years, 4 months ago (2010-12-06 07:01:31 UTC) #2
larrygritz
On 2010/12/06 07:01:31, Chris Foster wrote: > src/jpeg.imageio/jpegoutput.cpp:263: m_spec.nchannels = save_nchannels; > I'm confused by ...
13 years, 4 months ago (2010-12-06 18:33:59 UTC) #3
Chris Foster
13 years, 4 months ago (2010-12-07 02:23:30 UTC) #4
On Tue, Dec 7, 2010 at 4:33 AM,  <larrygritz@gmail.com> wrote:
> If you set m_spec.nchannels = 3 inside open(), then a call to
> write_image() using AutoStride will end up with all wrong strides as it
> makes the individual write_scanline calls.

Aha, that's what I was missing; I was thinking the user would call
write_scanline() directly, forgetting that the spec was also used in
write_image().  It would be nice to tack an extra note about that onto the
"Here's where we do the dirty work" comment.  Other than that, LGTM.

~Chris
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b