Bug 185956 - Enable subsampling for progressive JPEG images
Summary: Enable subsampling for progressive JPEG images
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-24 12:48 PDT by Chris Dumez
Modified: 2018-05-24 18:13 PDT (History)
5 users (show)

See Also:


Attachments
Patch (3.58 KB, patch)
2018-05-24 13:14 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (2.55 KB, patch)
2018-05-24 14:47 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2018-05-24 12:48:05 PDT
Optimize ImageDecoderCG::frameAllowSubsamplingAtIndex() currently checks if the image is a Progressive JPEG. We do not need CGImageSourceCopyPropertiesAtIndex() for non-JPEG images.
Comment 1 Chris Dumez 2018-05-24 13:14:58 PDT
Created attachment 341219 [details]
Patch
Comment 2 Geoffrey Garen 2018-05-24 14:02:36 PDT
Comment on attachment 341219 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=341219&action=review

r=me

> Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:388
> +    // Workaround for <rdar://problem/5184655> - Hang rendering very large progressive JPEG. Decoding progressive
> +    // images hangs for a very long time right now. Until this is fixed, don't sub-sample progressive images. This
> +    // will cause them to fail our large image check and they won't be decoded.
> +    // FIXME: Remove once underlying issue is fixed (<rdar://problem/5191418>)

This patch is fine -- but the FIXME here is about a bug that was fixed in 2014. Maybe we should just remove this code entirely?
Comment 3 Chris Dumez 2018-05-24 14:05:15 PDT
(In reply to Geoffrey Garen from comment #2)
> Comment on attachment 341219 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=341219&action=review
> 
> r=me
> 
> > Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:388
> > +    // Workaround for <rdar://problem/5184655> - Hang rendering very large progressive JPEG. Decoding progressive
> > +    // images hangs for a very long time right now. Until this is fixed, don't sub-sample progressive images. This
> > +    // will cause them to fail our large image check and they won't be decoded.
> > +    // FIXME: Remove once underlying issue is fixed (<rdar://problem/5191418>)
> 
> This patch is fine -- but the FIXME here is about a bug that was fixed in
> 2014. Maybe we should just remove this code entirely?

Simon, do you think we can remove this code entirely?
Comment 4 Chris Dumez 2018-05-24 14:36:35 PDT
(In reply to Chris Dumez from comment #3)
> (In reply to Geoffrey Garen from comment #2)
> > Comment on attachment 341219 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=341219&action=review
> > 
> > r=me
> > 
> > > Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:388
> > > +    // Workaround for <rdar://problem/5184655> - Hang rendering very large progressive JPEG. Decoding progressive
> > > +    // images hangs for a very long time right now. Until this is fixed, don't sub-sample progressive images. This
> > > +    // will cause them to fail our large image check and they won't be decoded.
> > > +    // FIXME: Remove once underlying issue is fixed (<rdar://problem/5191418>)
> > 
> > This patch is fine -- but the FIXME here is about a bug that was fixed in
> > 2014. Maybe we should just remove this code entirely?
> 
> Simon, do you think we can remove this code entirely?

I uploaded the test image to https://ibb.co/bG0pwT. I'll drop the code and try to load it.
Comment 5 Chris Dumez 2018-05-24 14:47:33 PDT
Created attachment 341227 [details]
Patch
Comment 6 WebKit Commit Bot 2018-05-24 18:12:37 PDT
Comment on attachment 341227 [details]
Patch

Clearing flags on attachment: 341227

Committed r232177: <https://trac.webkit.org/changeset/232177>
Comment 7 WebKit Commit Bot 2018-05-24 18:12:39 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-05-24 18:13:20 PDT
<rdar://problem/40541935>