diff --git a/docs/changelog.md b/docs/changelog.md index 8f80eddc8..a407df539 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -6,8 +6,9 @@ Requires libvips v8.15.1 ### 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) + [#4008](https://github.com/lovell/sharp/issues/4008) ### v0.33.2 - 12th January 2024 diff --git a/src/pipeline.cc b/src/pipeline.cc index b4d587b02..85a28569e 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -778,7 +778,7 @@ class PipelineWorker : public Napi::AsyncWorker { // Transform colours from embedded profile to output profile if ((baton->keepMetadata & VIPS_FOREIGN_KEEP_ICC) && baton->colourspaceInput != VIPS_INTERPRETATION_CMYK && baton->withIccProfile.empty() && sharp::HasProfile(image)) { - image = image.icc_transform("srgb", VImage::option() + image = image.icc_transform(processingProfile, VImage::option() ->set("embedded", TRUE) ->set("depth", sharp::Is16Bit(image.interpretation()) ? 16 : 8) ->set("intent", VIPS_INTENT_PERCEPTUAL));