mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Skip JPEG shrink-on-load for known rounding errors #3066
Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
This commit is contained in:
@@ -193,6 +193,10 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
} else if (shrink >= 2 * factor) {
|
||||
jpegShrinkOnLoad = 2;
|
||||
}
|
||||
// Skip shrink-on-load for known libjpeg rounding errors
|
||||
if (jpegShrinkOnLoad > 1 && shrink == jpegShrinkOnLoad) {
|
||||
jpegShrinkOnLoad /= 2;
|
||||
}
|
||||
} else if (inputImageType == sharp::ImageType::WEBP ||
|
||||
inputImageType == sharp::ImageType::SVG ||
|
||||
inputImageType == sharp::ImageType::PDF) {
|
||||
|
||||
Reference in New Issue
Block a user