Skip shrink-on-load for multi-page WebP #2714

This commit is contained in:
Lovell Fuller 2021-05-15 14:13:16 +01:00
parent a2d3fa729f
commit 5bd5e5052a
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,11 @@
Requires libvips v8.10.6
### v0.28.3 - TBD
* Skip shrink-on-load for multi-page WebP.
[#2714](https://github.com/lovell/sharp/issues/2714)
### v0.28.2 - 10th May 2021
* Allow `withMetadata` to set `density`.

View File

@ -227,7 +227,7 @@ class PipelineWorker : public Napi::AsyncWorker {
xshrink == yshrink && xshrink >= 2 * shrink_on_load_factor &&
(inputImageType == sharp::ImageType::JPEG || inputImageType == sharp::ImageType::WEBP) &&
baton->gamma == 0 && baton->topOffsetPre == -1 && baton->trimThreshold == 0.0 &&
image.width() > 3 && image.height() > 3
image.width() > 3 && image.height() > 3 && baton->input->pages == 1
) {
if (xshrink >= 8 * shrink_on_load_factor) {
xfactor = xfactor / 8;