Skip to content

Commit 5bd5e50

Browse files
committed
Skip shrink-on-load for multi-page WebP #2714
1 parent a2d3fa7 commit 5bd5e50

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
Requires libvips v8.10.6
66

7+
### v0.28.3 - TBD
8+
9+
* Skip shrink-on-load for multi-page WebP.
10+
[#2714](https://github.com/lovell/sharp/issues/2714)
11+
712
### v0.28.2 - 10th May 2021
813

914
* Allow `withMetadata` to set `density`.

src/pipeline.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class PipelineWorker : public Napi::AsyncWorker {
227227
xshrink == yshrink && xshrink >= 2 * shrink_on_load_factor &&
228228
(inputImageType == sharp::ImageType::JPEG || inputImageType == sharp::ImageType::WEBP) &&
229229
baton->gamma == 0 && baton->topOffsetPre == -1 && baton->trimThreshold == 0.0 &&
230-
image.width() > 3 && image.height() > 3
230+
image.width() > 3 && image.height() > 3 && baton->input->pages == 1
231231
) {
232232
if (xshrink >= 8 * shrink_on_load_factor) {
233233
xfactor = xfactor / 8;

0 commit comments

Comments
 (0)