-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some JPEG images in Display P3 color profile fail to produce description #1
Comments
Hi @AttilaTheFun, thanks for reporting this. The error message has copy-pasta—it should say "expected 'mluc' but got 'desc'". I’ll get this fixed. As to why this happens, on a quick glance, it looks like this image contains a profile marked as V4 but the |
Also do you mind if I extract the profile from this image and include it as data for a test case? |
@mandykoh Sure thing! I have a way to produce images that reproduce the issue reliably. iOS converts wide color images to the Display P3 color profile when using the UIGraphicsImageRenderer class which is the new (since iOS 10) standard way to export images from the user's camera roll for upload to a web server. Here is another image I exported using that same approach: The source image was a HEIC image that comes bundled with iOS simulators for testing. I used UIGraphicsImageRenderer to export it as a wide color jpeg. I saw that the value was actually a v2 desc field. I'm not sure if there is a mulc tag after that or not. Out of curiosity, I downloaded both the v2 and v4 specifications from color.org, and I see that there is some talk of backwards compatibility with the v2 desc tag in the v4 spec. I suspect this image may have both tags so that v2 readers can display the desc and v4 readers would either ignore the field or map it into a mulc tag. From the v4 spec:
Per the spec, I think the solution here is to parse the v2 desc tag as ASCII text first, then map the ASCII text to UTF-16 and store it in the MultiLocalisedUnicode entriesByLanguageCountry map. If the image has a separate enUS localized value, it would overwrite this value. But if it does not we'd at least have an English localization. |
Thanks for the info! Given that we’re abstracting over v2/v4, and that you can tell whether it’s a Can you try v0.34.0 and see if it fixes this issue for you? |
Yep! I just verified that v0.34.0 fixes the issue and I'm able to parse the description of Display P3 images. |
Hi! I'm trying out your library for my image processing web server and seeing a strange bug when trying to get the description of the color space for some JPG images with a Display P3 color profile. I have attached one such image:
When I try to decode the description, I get the error "expected 'desc' but got 'desc'" even though the macOS preview window correctly shows the color space as Display P3.
The text was updated successfully, but these errors were encountered: