-
Notifications
You must be signed in to change notification settings - Fork 111
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
ICCP support for new image formats #156
Conversation
So from the code review, deletes cache for any of the animated support if it doesn't have animation right? (just want to put together a good changelog for all the awesome optimizations) Does this also revert the "support ICC on PNG disables animation"... aka this supports ICC with animation? |
yes
No. PNG files can have other chunks besides an ICC profile that affect how the colors should look (example). GDI+ handles these, but I'm not sure how to with LCMS. I'll try adding ICCP support with TurboJPEG. |
|
||
CMSAPI void CMSEXPORT cmsDeleteTransform(cmsHTRANSFORM hTransform); | ||
|
||
CMSAPI void CMSEXPORT cmsDoTransform(cmsHTRANSFORM Transform, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the original function signature doesn't use that style
It looks like there's no way to get an ICC profile with the TurboJPEG API, so we'd have to use the libjpeg API to read the image separately. I think it would look something like this: jpeg_decompress_struct cinfo;
JOCTET* icc_data_ptr = NULL;
unsigned int icc_data_len = 0;
jpeg_create_decompress(&cinfo);
jpeg_mem_src(&cinfo, (unsigned char*)buffer, sizebytes);
jpeg_save_markers(&cinfo, JPEG_APP0 + 2, 0xFFFF);
jpeg_read_header(&cinfo, false);
jpeg_read_icc_profile(&cinfo, &icc_data_ptr, &icc_data_len);
// ... and then change the transform functions to handle 3 channel data, with proper padding for the output. I'll leave it as is for now. |
Cool. Thanks for the investigation. I'm sure people will be plenty happy with the addition of ICC on those 4 new formats! 😀 |
… AVIF images. It applies automatically regardless of UseEmbeddedColorProfiles option. Delete cache for immediately AVIF/JXL/PNG if not animated image. Merge PR #156 by https://github.com/qbnu
Adds support for ICC Profiles embedded in WebP, JPEG XL, HEIF/HEIC and AVIF images.
Fixes #148