Remove animation props from single page images #2890

This commit is contained in:
Lovell Fuller
2021-10-18 20:27:10 +01:00
parent 7ae151362b
commit d359331426
3 changed files with 27 additions and 0 deletions

View File

@@ -289,6 +289,10 @@ class PipelineWorker : public Napi::AsyncWorker {
yfactor = static_cast<double>(shrunkOnLoadHeight) / static_cast<double>(targetResizeHeight);
}
}
// Remove animation properties from single page images
if (baton->input->pages == 1) {
image = sharp::RemoveAnimationProperties(image);
}
// Ensure we're using a device-independent colour space
char const *processingProfile = image.interpretation() == VIPS_INTERPRETATION_RGB16 ? "p3" : "srgb";