From 75fedf1b75c8bb4c6496f5b23da29eeebfec1076 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Mon, 26 Feb 2024 15:23:50 +0000 Subject: [PATCH] Ensure keepIccProfile retains P3 input profiles #4008 --- docs/changelog.md | 3 ++- src/pipeline.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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));