mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Prevent upsampling via libwebp (#3267)
This commit is contained in:
@@ -188,8 +188,10 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
if (jpegShrinkOnLoad > 1 && static_cast<int>(shrink) == jpegShrinkOnLoad) {
|
||||
jpegShrinkOnLoad /= 2;
|
||||
}
|
||||
} else if (inputImageType == sharp::ImageType::WEBP ||
|
||||
inputImageType == sharp::ImageType::SVG ||
|
||||
} else if (inputImageType == sharp::ImageType::WEBP && shrink > 1.0) {
|
||||
// Avoid upscaling via webp
|
||||
scale = 1.0 / shrink;
|
||||
} else if (inputImageType == sharp::ImageType::SVG ||
|
||||
inputImageType == sharp::ImageType::PDF) {
|
||||
scale = 1.0 / shrink;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user