Bug 79457

Summary: [chromium] JPEG RGB image with Adode Marker fails to turbo swizzle decode
Product: WebKit Reporter: noel gordon <noel.gordon>
Component: New BugsAssignee: noel gordon <noel.gordon>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, dcommander, enne, hbono, Hironori.Fujii, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=200163
Bug Depends on:    
Bug Blocks: 59670    
Attachments:
Description Flags
apron.jpg
none
Patch
none
Patch none

noel gordon
Reported 2012-02-24 00:18:16 PST
Attachments
apron.jpg (9.01 KB, image/jpeg)
2012-02-24 00:32 PST, noel gordon
no flags
Patch (83.91 KB, patch)
2012-02-24 01:48 PST, noel gordon
no flags
Patch (1.64 KB, patch)
2012-02-27 23:06 PST, noel gordon
no flags
noel gordon
Comment 1 2012-02-24 00:28:45 PST
If a JPEG has no JFIF marker, the Adode Marker must be used to determine the image color space for decoding by consulting the transform flag values of the Adobe Marker: 2 - The image is encoded as YCCK (implicitly converted from CMYK on encoding). 1 - The image is encoded as YCbCr (implicitly converted from RGB on encoding). 0 - Unknown. 3-channel images are assumed to be RGB, 4-channel images are assumed to be CMYK. The attached image has no JFIF marker, but has an Adobe marker transform 0, meaning an RGB image since it has 3 color channels. Such images fail to decode in libjpeg-turbo if swizzle decoding is active.
noel gordon
Comment 2 2012-02-24 00:32:04 PST
Created attachment 128675 [details] apron.jpg Image meta details: % jpegtopnm --comments --verbose --dumpexif apron.jpg > test.ppm Start of Image Adobe APP14 marker: version 100, flags 0x0000 0x0000, transform 0 <-- Adode Marker, transform 0 Define Quantization Table 0 precision 0 Start Of Frame 0xc0: width=225, height=156, components=3 <-- 3 color components Component 82: 1hx1v q=0 Component 71: 1hx1v q=0 Component 66: 1hx1v q=0 Define Huffman Table 0x00 Define Huffman Table 0x10 Start Of Scan: 3 components Component 82: dc=0 ac=0 Component 71: dc=0 ac=0 Component 66: dc=0 ac=0 Ss=0, Se=63, Ah=0, Al=0 jpegtopnm: input color space is 2 (JCS_RGB) <-- RGB color space, since 3 color components ...
noel gordon
Comment 3 2012-02-24 01:48:42 PST
Adam Barth
Comment 4 2012-02-24 15:18:04 PST
Comment on attachment 128689 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=128689&action=review > Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp:249 > + // FIXME: swizzler incorrectly handles Adobe transform=0 images swizzler => The swizzler (Comments should use complete sentences.)
noel gordon
Comment 5 2012-02-24 15:38:03 PST
Roger that. Flaky connection mode here. Will cq+ and fix in followup.
WebKit Review Bot
Comment 6 2012-02-24 16:50:05 PST
Comment on attachment 128689 [details] Patch Clearing flags on attachment: 128689 Committed r108870: <http://trac.webkit.org/changeset/108870>
WebKit Review Bot
Comment 7 2012-02-24 16:50:10 PST
All reviewed patches have been landed. Closing bug.
DRC
Comment 8 2012-02-24 17:28:38 PST
I can't tell whether this is working around an issue in libjpeg-turbo or in the layers above it. If this is something that needs to be fixed in libjpeg-turbo, let me know.
Adrienne Walker
Comment 9 2012-02-24 18:57:25 PST
noel gordon
Comment 10 2012-02-24 23:21:21 PST
noel gordon
Comment 11 2012-02-26 23:31:43 PST
(In reply to comment #8) > I can't tell whether this is working around an issue in libjpeg-turbo or in the layers above it. If this is something that needs to be fixed in libjpeg-turbo, let me know. Yes it's a work-around of sorts, for the reasons noted in http://code.google.com/p/chromium/issues/detail?id=115287#c15. Seems there's no JSC_RGB -> JSC_EXT_BGRA etc converter. I believe hbono-san is preparing a libjpeg-turbo patch to remedy that ...
Hironori Bono
Comment 12 2012-02-27 00:06:20 PST
Greetings, Thanks for your comments. I have filed an upstream bug (*1) and uploaded my quick fix (*2). (*1) https://sourceforge.net/tracker/?func=detail&aid=3494910&group_id=303195&atid=1278158 (*2) http://sourceforge.net/tracker/?func=detail&aid=3494911&group_id=303195&atid=1278160 Regards, Hironori Bono (In reply to comment #11) > Yes it's a work-around of sorts, for the reasons noted in http://code.google.com/p/chromium/issues/detail?id=115287#c15. Seems there's no JSC_RGB -> JSC_EXT_BGRA etc converter. I believe hbono-san is preparing a libjpeg-turbo patch to remedy that ...
noel gordon
Comment 13 2012-02-27 23:06:31 PST
Reopening to attach new patch.
noel gordon
Comment 14 2012-02-27 23:06:36 PST
WebKit Review Bot
Comment 15 2012-02-28 00:08:06 PST
Comment on attachment 129193 [details] Patch Clearing flags on attachment: 129193 Committed r109086: <http://trac.webkit.org/changeset/109086>
WebKit Review Bot
Comment 16 2012-02-28 00:08:11 PST
All reviewed patches have been landed. Closing bug.
DRC
Comment 17 2012-03-11 15:07:37 PDT
Fixed upstream
noel gordon
Comment 18 2012-03-12 03:51:24 PDT
r808 LGTM. Will it be part of the 1.2.0 libjpeg-turbo release?
DRC
Comment 19 2012-03-12 05:24:24 PDT
1.2.0 has been out for some time. It will be part of 1.2.1.
Note You need to log in before you can comment on or make changes to this bug.