Ensure profile-less CMYK roundtrip skips space conv #3620

This commit is contained in:
Lovell Fuller
2023-04-11 20:31:57 +01:00
parent 2e0f789c9b
commit b763801d68
3 changed files with 20 additions and 1 deletions

View File

@@ -322,7 +322,10 @@ class PipelineWorker : public Napi::AsyncWorker {
} catch(...) {
sharp::VipsWarningCallback(nullptr, G_LOG_LEVEL_WARNING, "Invalid embedded profile", nullptr);
}
} else if (image.interpretation() == VIPS_INTERPRETATION_CMYK) {
} else if (
image.interpretation() == VIPS_INTERPRETATION_CMYK &&
baton->colourspaceInput != VIPS_INTERPRETATION_CMYK
) {
image = image.icc_transform(processingProfile, VImage::option()
->set("input_profile", "cmyk")
->set("intent", VIPS_INTENT_PERCEPTUAL));