diff --git a/src/pipeline.h b/src/pipeline.h index b0cca2b16..f9d95b18f 100644 --- a/src/pipeline.h +++ b/src/pipeline.h @@ -327,7 +327,6 @@ struct PipelineBaton { ensureAlpha(-1.0), colourspaceInput(VIPS_INTERPRETATION_LAST), colourspace(VIPS_INTERPRETATION_LAST), - delay{-1}, loop(-1), tileSize(256), tileOverlap(0), diff --git a/test/unit/webp.js b/test/unit/webp.js index f87f3caf0..a9b818f85 100644 --- a/test/unit/webp.js +++ b/test/unit/webp.js @@ -183,6 +183,15 @@ describe('WebP', function () { assert.deepStrictEqual(updated.delay, expectedDelay); }); + it('should preserve delay between frames', async () => { + const updated = await sharp(fixtures.inputWebPAnimated, { pages: -1 }) + .webp() + .toBuffer() + .then(data => sharp(data, { pages: -1 }).metadata()); + + assert.deepStrictEqual(updated.delay, [120, 120, 90, 120, 120, 90, 120, 90, 30]); + }); + it('should work with streams when only animated is set', function (done) { fs.createReadStream(fixtures.inputWebPAnimated) .pipe(sharp({ animated: true }))