Bug 258267 - [Cocoa] Custom colorspaces in JPEG XL images don't work on downlevels
Summary: [Cocoa] Custom colorspaces in JPEG XL images don't work on downlevels
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
: 258285 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-06-18 17:22 PDT by Myles C. Maxfield
Modified: 2023-06-22 20:11 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2023-06-18 17:22:23 PDT
We build for downlevels with USE(JPEGXL) but not USE(LCMS). We should port the existing color conversion code to use Core Graphics.

The way to do this is:
1. tryDecodeICCColorProfile() can use CGColorSpaceCreateWithICCData() with a CFData
2. Create a CGColorConversionInfo from the source and destination color space
3. Use vImageConverter_CreateWithCGColorConversionInfo() to create a converter
4. vImageConvert_AnyToAny()

We might need a custom refptr for the vImageConverter. We can probably do this with custom RefPtr traits, like I did in 264884@main
Comment 1 Myles C. Maxfield 2023-06-19 14:50:30 PDT
<rdar://problem/111012276>
Comment 2 Myles C. Maxfield 2023-06-19 14:50:35 PDT
*** Bug 258285 has been marked as a duplicate of this bug. ***
Comment 3 Myles C. Maxfield 2023-06-19 14:55:46 PDT
Pull request: https://github.com/WebKit/WebKit/pull/15098
Comment 4 EWS 2023-06-22 20:11:52 PDT
Committed 265440@main (19b823079b6d): <https://commits.webkit.org/265440@main>

Reviewed commits have been landed. Closing PR #15098 and removing active labels.