Bug 230209 - display-p3 canvas toDataURL / toBlob returns sRGB data for JPEGs
Summary: display-p3 canvas toDataURL / toBlob returns sRGB data for JPEGs
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks: 225140
  Show dependency treegraph
 
Reported: 2021-09-12 22:59 PDT by Cameron McCormack (:heycam)
Modified: 2021-09-16 22:32 PDT (History)
16 users (show)

See Also:


Attachments
Patch with squashed dependencies for EWS (253.76 KB, patch)
2021-09-12 23:29 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Patch with squashed dependencies for EWS (254.69 KB, patch)
2021-09-13 00:24 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Patch (18.58 KB, patch)
2021-09-16 21:14 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Patch (18.57 KB, patch)
2021-09-16 21:33 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2021-09-12 22:59:15 PDT
toDataURL() on a display-p3 canvas seems to work for an image/png destination but not image/jpeg.
Comment 1 Cameron McCormack (:heycam) 2021-09-12 22:59:34 PDT
<rdar://82948457>
Comment 2 Radar WebKit Bug Importer 2021-09-12 22:59:51 PDT
<rdar://problem/83041091>
Comment 3 Cameron McCormack (:heycam) 2021-09-12 23:01:05 PDT
<rdar://82948457>
Comment 4 Cameron McCormack (:heycam) 2021-09-12 23:29:44 PDT
Created attachment 438017 [details]
Patch with squashed dependencies for EWS
Comment 5 EWS Watchlist 2021-09-12 23:30:45 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 6 Cameron McCormack (:heycam) 2021-09-13 00:24:48 PDT
Created attachment 438018 [details]
Patch with squashed dependencies for EWS
Comment 7 Sam Weinig 2021-09-15 09:34:30 PDT
Comment on attachment 438018 [details]
Patch with squashed dependencies for EWS

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

> Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.cpp:99
> +    if (CGColorSpaceGetModel(imageBufferColorSpace.platformColorSpace()) != kCGColorSpaceModelRGB)
> +        return sRGBColorSpaceRef();

This is another spot where CGBitmapContextCreateForFlatteningImage might make sense.
Comment 8 Cameron McCormack (:heycam) 2021-09-16 21:14:07 PDT
Created attachment 438441 [details]
Patch
Comment 9 Cameron McCormack (:heycam) 2021-09-16 21:14:41 PDT
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/30838
Comment 10 EWS 2021-09-16 21:24:20 PDT
ChangeLog entry in LayoutTests/imported/w3c/ChangeLog contains OOPS!.
Comment 11 Cameron McCormack (:heycam) 2021-09-16 21:33:23 PDT
Created attachment 438443 [details]
Patch
Comment 12 EWS 2021-09-16 22:32:46 PDT
Committed r282634 (241791@main): <https://commits.webkit.org/241791@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 438443 [details].