Ensure keepIccProfile retains P3 input profiles #4008

This commit is contained in:
Lovell Fuller 2024-02-26 15:23:50 +00:00
parent debdacb726
commit 75fedf1b75
2 changed files with 3 additions and 2 deletions

View File

@ -6,8 +6,9 @@ Requires libvips v8.15.1
### v0.33.3 - TBD ### v0.33.3 - TBD
* Ensure `keepIccProfile` retains CMYK input profiles. * Ensure `keepIccProfile` retains P3 and CMYK input profiles.
[#3906](https://github.com/lovell/sharp/issues/3906) [#3906](https://github.com/lovell/sharp/issues/3906)
[#4008](https://github.com/lovell/sharp/issues/4008)
### v0.33.2 - 12th January 2024 ### v0.33.2 - 12th January 2024

View File

@ -778,7 +778,7 @@ class PipelineWorker : public Napi::AsyncWorker {
// Transform colours from embedded profile to output profile // Transform colours from embedded profile to output profile
if ((baton->keepMetadata & VIPS_FOREIGN_KEEP_ICC) && baton->colourspaceInput != VIPS_INTERPRETATION_CMYK && if ((baton->keepMetadata & VIPS_FOREIGN_KEEP_ICC) && baton->colourspaceInput != VIPS_INTERPRETATION_CMYK &&
baton->withIccProfile.empty() && sharp::HasProfile(image)) { baton->withIccProfile.empty() && sharp::HasProfile(image)) {
image = image.icc_transform("srgb", VImage::option() image = image.icc_transform(processingProfile, VImage::option()
->set("embedded", TRUE) ->set("embedded", TRUE)
->set("depth", sharp::Is16Bit(image.interpretation()) ? 16 : 8) ->set("depth", sharp::Is16Bit(image.interpretation()) ? 16 : 8)
->set("intent", VIPS_INTENT_PERCEPTUAL)); ->set("intent", VIPS_INTENT_PERCEPTUAL));