Bug 171042 - [CG] Provide a type identifier hint to the CGImageSource so getting the type identifier is more accurate
Summary: [CG] Provide a type identifier hint to the CGImageSource so getting the type ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks: 170700
  Show dependency treegraph
 
Reported: 2017-04-19 22:23 PDT by Said Abou-Hallawa
Modified: 2017-06-06 12:28 PDT (History)
7 users (show)

See Also:


Attachments
Patch (32.50 KB, patch)
2017-04-19 22:30 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (38.61 KB, patch)
2017-04-20 00:23 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (52.79 KB, patch)
2017-04-20 10:37 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (53.19 KB, patch)
2017-04-20 11:38 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (66.69 KB, patch)
2017-04-20 12:04 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 (589.63 KB, application/zip)
2017-04-20 13:06 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews117 for mac-elcapitan (1.48 MB, application/zip)
2017-04-20 13:12 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews103 for mac-elcapitan (459.41 KB, application/zip)
2017-04-20 13:22 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews124 for ios-simulator-wk2 (804.94 KB, application/zip)
2017-04-20 13:32 PDT, Build Bot
no flags Details
Patch (66.25 KB, patch)
2017-04-20 17:53 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (66.30 KB, patch)
2017-04-20 18:15 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-elcapitan (472.09 KB, application/zip)
2017-04-20 19:07 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews112 for mac-elcapitan (1.33 MB, application/zip)
2017-04-20 19:15 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (388.15 KB, application/zip)
2017-04-20 19:18 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews125 for ios-simulator-wk2 (11.30 MB, application/zip)
2017-04-20 19:29 PDT, Build Bot
no flags Details
Patch (67.04 KB, patch)
2017-04-21 09:58 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-elcapitan (909.59 KB, application/zip)
2017-04-21 10:40 PDT, Build Bot
no flags Details
Patch (67.27 KB, patch)
2017-04-21 10:50 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (807.70 KB, application/zip)
2017-04-21 11:45 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews101 for mac-elcapitan (716.49 KB, application/zip)
2017-04-21 11:49 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews116 for mac-elcapitan (1.46 MB, application/zip)
2017-04-21 11:57 PDT, Build Bot
no flags Details
Patch (67.12 KB, patch)
2017-04-21 12:22 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-elcapitan (429.29 KB, application/zip)
2017-04-21 13:54 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews121 for ios-simulator-wk2 (815.53 KB, application/zip)
2017-04-21 14:02 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews112 for mac-elcapitan (461.47 KB, application/zip)
2017-04-21 14:10 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews107 for mac-elcapitan-wk2 (398.11 KB, application/zip)
2017-04-21 14:12 PDT, Build Bot
no flags Details
Patch (67.26 KB, patch)
2017-04-21 14:59 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (57.44 KB, patch)
2017-04-21 16:49 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (53.38 KB, patch)
2017-04-21 17:15 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (50.12 KB, patch)
2017-04-24 11:19 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (50.00 KB, patch)
2017-04-24 11:56 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (50.00 KB, patch)
2017-04-24 13:59 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (62.93 KB, patch)
2017-04-24 17:15 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (62.79 KB, patch)
2017-04-24 17:42 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2017-04-19 22:23:48 PDT
The image URL can be used to get the type identifier hint. Without providing this hint, the image type identifier is not accurate for image formats.
Comment 1 Said Abou-Hallawa 2017-04-19 22:30:18 PDT
Created attachment 307557 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2017-04-19 22:31:06 PDT
<rdar://problem/31725669>
Comment 3 Said Abou-Hallawa 2017-04-20 00:23:09 PDT
Created attachment 307572 [details]
Patch
Comment 4 Alexey Proskuryakov 2017-04-20 10:09:46 PDT
Comment on attachment 307572 [details]
Patch

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

> Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:51
> +CFStringRef CGImageSourceGetTypeWithURL(CFURLRef, CFStringRef);

This function should not be declared in the .cpp file. Please use an actual *SPI.h header, similar to WebCore/platform/spi/cg/CoreGraphicsSPI.h. I don't think that we have ImageIOSPI.h yet - maybe we didn't need it before, or maybe those went into some other header.

Furthermore, this pattern is not quite correct. We want to redeclare functions when APPLE_INTERNAL_SDK is true - that way, the compiler has a chance to detect mistakes and changes in signatures.

Ditto for kCGImageSourceSubsampleFactor/kCGImageSourceShouldCacheImmediately. These are exported from ImageIO.framework, so we should be using the actual exported symbol even in open source builds, not create a new constant with the same name.
Comment 5 Said Abou-Hallawa 2017-04-20 10:37:57 PDT
Created attachment 307598 [details]
Patch
Comment 6 Alexey Proskuryakov 2017-04-20 10:45:25 PDT
Comment on attachment 307598 [details]
Patch

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

> Source/WebCore/ChangeLog:80
> +        * platform/spi/cg/ImageIOSPI.h: Added.

Not sure if this goes to cocoa/ or to cg/.

> Source/WebCore/platform/spi/cg/ImageIOSPI.h:35
> +extern const CFStringRef kCGImageSourceSubsampleFactor;
> +extern const CFStringRef kCGImageSourceShouldCacheImmediately;

I think that constants can and should be redeclared, too.
Comment 7 Said Abou-Hallawa 2017-04-20 11:38:05 PDT
Created attachment 307604 [details]
Patch
Comment 8 Said Abou-Hallawa 2017-04-20 12:04:12 PDT
Created attachment 307609 [details]
Patch
Comment 9 Build Bot 2017-04-20 13:06:11 PDT
Comment on attachment 307609 [details]
Patch

Attachment 307609 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/3571451

Number of test failures exceeded the failure limit.
Comment 10 Build Bot 2017-04-20 13:06:12 PDT
Created attachment 307622 [details]
Archive of layout-test-results from ews105 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 11 Build Bot 2017-04-20 13:12:36 PDT
Comment on attachment 307609 [details]
Patch

Attachment 307609 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/3571470

Number of test failures exceeded the failure limit.
Comment 12 Build Bot 2017-04-20 13:12:38 PDT
Created attachment 307624 [details]
Archive of layout-test-results from ews117 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 13 Build Bot 2017-04-20 13:22:18 PDT
Comment on attachment 307609 [details]
Patch

Attachment 307609 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/3571585

Number of test failures exceeded the failure limit.
Comment 14 Build Bot 2017-04-20 13:22:19 PDT
Created attachment 307625 [details]
Archive of layout-test-results from ews103 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 15 Build Bot 2017-04-20 13:32:10 PDT
Comment on attachment 307609 [details]
Patch

Attachment 307609 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/3571526

Number of test failures exceeded the failure limit.
Comment 16 Build Bot 2017-04-20 13:32:12 PDT
Created attachment 307631 [details]
Archive of layout-test-results from ews124 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews124  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.6
Comment 17 Said Abou-Hallawa 2017-04-20 17:53:53 PDT
Created attachment 307669 [details]
Patch
Comment 18 Said Abou-Hallawa 2017-04-20 18:15:42 PDT
Created attachment 307671 [details]
Patch
Comment 19 Build Bot 2017-04-20 19:07:43 PDT
Comment on attachment 307671 [details]
Patch

Attachment 307671 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/3573462

Number of test failures exceeded the failure limit.
Comment 20 Build Bot 2017-04-20 19:07:45 PDT
Created attachment 307676 [details]
Archive of layout-test-results from ews102 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 21 Build Bot 2017-04-20 19:15:14 PDT
Comment on attachment 307671 [details]
Patch

Attachment 307671 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/3573464

Number of test failures exceeded the failure limit.
Comment 22 Build Bot 2017-04-20 19:15:16 PDT
Created attachment 307678 [details]
Archive of layout-test-results from ews112 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 23 Build Bot 2017-04-20 19:18:56 PDT
Comment on attachment 307671 [details]
Patch

Attachment 307671 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/3573492

Number of test failures exceeded the failure limit.
Comment 24 Build Bot 2017-04-20 19:18:58 PDT
Created attachment 307680 [details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 25 Build Bot 2017-04-20 19:29:42 PDT
Comment on attachment 307671 [details]
Patch

Attachment 307671 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/3573475

Number of test failures exceeded the failure limit.
Comment 26 Build Bot 2017-04-20 19:29:44 PDT
Created attachment 307683 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.6
Comment 27 Said Abou-Hallawa 2017-04-21 09:58:26 PDT
Created attachment 307743 [details]
Patch
Comment 28 Build Bot 2017-04-21 10:40:47 PDT
Comment on attachment 307743 [details]
Patch

Attachment 307743 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/3577069

Number of test failures exceeded the failure limit.
Comment 29 Build Bot 2017-04-21 10:40:49 PDT
Created attachment 307747 [details]
Archive of layout-test-results from ews102 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 30 Said Abou-Hallawa 2017-04-21 10:50:03 PDT
Created attachment 307749 [details]
Patch
Comment 31 Build Bot 2017-04-21 11:45:29 PDT
Comment on attachment 307749 [details]
Patch

Attachment 307749 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/3577349

Number of test failures exceeded the failure limit.
Comment 32 Build Bot 2017-04-21 11:45:30 PDT
Created attachment 307762 [details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 33 Build Bot 2017-04-21 11:49:00 PDT
Comment on attachment 307749 [details]
Patch

Attachment 307749 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/3577373

Number of test failures exceeded the failure limit.
Comment 34 Build Bot 2017-04-21 11:49:01 PDT
Created attachment 307763 [details]
Archive of layout-test-results from ews101 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 35 Build Bot 2017-04-21 11:57:09 PDT
Comment on attachment 307749 [details]
Patch

Attachment 307749 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/3577368

Number of test failures exceeded the failure limit.
Comment 36 Build Bot 2017-04-21 11:57:11 PDT
Created attachment 307765 [details]
Archive of layout-test-results from ews116 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 37 Said Abou-Hallawa 2017-04-21 12:22:42 PDT
Created attachment 307773 [details]
Patch
Comment 38 Build Bot 2017-04-21 13:54:26 PDT
Comment on attachment 307773 [details]
Patch

Attachment 307773 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/3578125

Number of test failures exceeded the failure limit.
Comment 39 Build Bot 2017-04-21 13:54:28 PDT
Created attachment 307792 [details]
Archive of layout-test-results from ews102 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 40 Build Bot 2017-04-21 14:02:56 PDT
Comment on attachment 307773 [details]
Patch

Attachment 307773 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/3578039

Number of test failures exceeded the failure limit.
Comment 41 Build Bot 2017-04-21 14:02:57 PDT
Created attachment 307796 [details]
Archive of layout-test-results from ews121 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews121  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.6
Comment 42 Build Bot 2017-04-21 14:10:46 PDT
Comment on attachment 307773 [details]
Patch

Attachment 307773 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/3578202

Number of test failures exceeded the failure limit.
Comment 43 Build Bot 2017-04-21 14:10:48 PDT
Created attachment 307798 [details]
Archive of layout-test-results from ews112 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 44 Build Bot 2017-04-21 14:12:03 PDT
Comment on attachment 307773 [details]
Patch

Attachment 307773 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/3578191

Number of test failures exceeded the failure limit.
Comment 45 Build Bot 2017-04-21 14:12:04 PDT
Created attachment 307799 [details]
Archive of layout-test-results from ews107 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 46 Said Abou-Hallawa 2017-04-21 14:59:14 PDT
Created attachment 307814 [details]
Patch
Comment 47 Said Abou-Hallawa 2017-04-21 16:49:26 PDT
Created attachment 307840 [details]
Patch
Comment 48 Said Abou-Hallawa 2017-04-21 17:15:32 PDT
Created attachment 307844 [details]
Patch
Comment 49 Said Abou-Hallawa 2017-04-24 11:19:38 PDT
Created attachment 307990 [details]
Patch
Comment 50 Said Abou-Hallawa 2017-04-24 11:56:13 PDT
Created attachment 307992 [details]
Patch
Comment 51 Tim Horton 2017-04-24 11:59:45 PDT
Comment on attachment 307990 [details]
Patch

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

> Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:162
> +        RetainPtr<CFMutableDictionaryRef> options = adoptCF(CFDictionaryCreateMutable(nullptr, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));

Why Mutable? Should be able to just use CFDictionaryCreate with your one value.

> Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:242
> +EncodedDataStatus PNGImageDecoder::encodedDataStatus() const

I don't think all this consting and const_casting is good. Can you just make the new thing mutable instead?
Comment 52 Said Abou-Hallawa 2017-04-24 13:59:56 PDT
Created attachment 308006 [details]
Patch
Comment 53 Said Abou-Hallawa 2017-04-24 14:06:19 PDT
Comment on attachment 307990 [details]
Patch

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

>> Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:162
>> +        RetainPtr<CFMutableDictionaryRef> options = adoptCF(CFDictionaryCreateMutable(nullptr, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
> 
> Why Mutable? Should be able to just use CFDictionaryCreate with your one value.

Done.

>> Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:242
>> +EncodedDataStatus PNGImageDecoder::encodedDataStatus() const
> 
> I don't think all this consting and const_casting is good. Can you just make the new thing mutable instead?

I agree that this looks ugly but I think it is okay since the const here is a logical const. I think the best fix is to move the call to decode() into ImageDecoder::setData() and make encodedDataStatus() just returns a member of the ImageDecoder class. Please see my comment https://bugs.webkit.org/show_bug.cgi?id=170730#c10. If Miguel takes this approach, things will be fixed the way we want. If not I am going to file a follow up bug to remove this ugliness.
Comment 54 Tim Horton 2017-04-24 16:03:44 PDT
Comment on attachment 308006 [details]
Patch

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

> Source/WebCore/platform/graphics/Image.cpp:80
> -String Image::sourceURL() const
> +URL Image::sourceURL() const

If it were me, I would do the mechanical change in a separate patch, but this is fine too.

> Source/WebCore/platform/graphics/Image.h:124
> +    virtual String filenameExtension() const { return emptyString(); } // null string if unknown

The comment is no longer true. Empty string != null string. That change seems potentially problematic for callers, too.

> Source/WebCore/platform/image-decoders/ImageDecoder.h:44
> +class URL;

This file is indented wrong, but you should probably stick with it instead of doing your own thing.
Comment 55 Said Abou-Hallawa 2017-04-24 17:15:45 PDT
Created attachment 308025 [details]
Patch
Comment 56 WebKit Commit Bot 2017-04-24 17:17:10 PDT
Comment on attachment 308025 [details]
Patch

Rejecting attachment 308025 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'apply-attachment', '--no-update', '--non-interactive', 308025, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
ecoder.h
patching file Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
patching file Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h
patching file Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
patching file Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h
patching file Source/WebCore/platform/spi/cg/ImageIOSPI.h

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.webkit.org/results/3597784
Comment 57 Said Abou-Hallawa 2017-04-24 17:42:10 PDT
Created attachment 308029 [details]
Patch
Comment 58 WebKit Commit Bot 2017-04-24 18:23:58 PDT
Comment on attachment 308029 [details]
Patch

Clearing flags on attachment: 308029

Committed r215710: <http://trac.webkit.org/changeset/215710>
Comment 59 WebKit Commit Bot 2017-04-24 18:24:01 PDT
All reviewed patches have been landed.  Closing bug.
Comment 60 Simon Fraser (smfr) 2017-04-25 08:48:09 PDT
Comment on attachment 308029 [details]
Patch

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

> Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:159
> +    RetainPtr<CFURLRef> url = sourceURL.createCFURL();
> +    RetainPtr<CFStringRef> utiHint = adoptCF(CGImageSourceGetTypeWithURL(url.get(), nullptr));

What does this do with (potentially huge) data URIs?
Comment 61 Said Abou-Hallawa 2017-06-06 12:28:52 PDT
Comment on attachment 308029 [details]
Patch

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

>> Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:159
>> +    RetainPtr<CFStringRef> utiHint = adoptCF(CGImageSourceGetTypeWithURL(url.get(), nullptr));
> 
> What does this do with (potentially huge) data URIs?

This code has changed in <http://trac.webkit.org/changeset/217246>. The URL is not used anymore to get the type hint. Instead we get the hint from the data and we call CGImageSourceGetTypeWithData() instead of calling CGImageSourceGetTypeWithURL().