mirror of
https://github.com/lovell/sharp.git
synced 2026-02-05 14:16:17 +01:00
Add ignoreIcc input option to ignore embedded ICC profile
This commit is contained in:
@@ -320,7 +320,8 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
if (
|
||||
sharp::HasProfile(image) &&
|
||||
image.interpretation() != VIPS_INTERPRETATION_LABS &&
|
||||
image.interpretation() != VIPS_INTERPRETATION_GREY16
|
||||
image.interpretation() != VIPS_INTERPRETATION_GREY16 &&
|
||||
!baton->input->ignoreIcc
|
||||
) {
|
||||
// Convert to sRGB/P3 using embedded profile
|
||||
try {
|
||||
@@ -329,7 +330,7 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
->set("depth", image.interpretation() == VIPS_INTERPRETATION_RGB16 ? 16 : 8)
|
||||
->set("intent", VIPS_INTENT_PERCEPTUAL));
|
||||
} catch(...) {
|
||||
// Ignore failure of embedded profile
|
||||
sharp::VipsWarningCallback(nullptr, G_LOG_LEVEL_WARNING, "Invalid embedded profile", nullptr);
|
||||
}
|
||||
} else if (image.interpretation() == VIPS_INTERPRETATION_CMYK) {
|
||||
image = image.icc_transform(processingProfile, VImage::option()
|
||||
|
||||
Reference in New Issue
Block a user