mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Ensure delays of the origin image is preserved (#3062)
By not initializing the delay vector, since we assume it's empty by default. See: #3061.
This commit is contained in:
parent
68823a5edb
commit
7aa340232e
@ -327,7 +327,6 @@ struct PipelineBaton {
|
|||||||
ensureAlpha(-1.0),
|
ensureAlpha(-1.0),
|
||||||
colourspaceInput(VIPS_INTERPRETATION_LAST),
|
colourspaceInput(VIPS_INTERPRETATION_LAST),
|
||||||
colourspace(VIPS_INTERPRETATION_LAST),
|
colourspace(VIPS_INTERPRETATION_LAST),
|
||||||
delay{-1},
|
|
||||||
loop(-1),
|
loop(-1),
|
||||||
tileSize(256),
|
tileSize(256),
|
||||||
tileOverlap(0),
|
tileOverlap(0),
|
||||||
|
@ -183,6 +183,15 @@ describe('WebP', function () {
|
|||||||
assert.deepStrictEqual(updated.delay, expectedDelay);
|
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) {
|
it('should work with streams when only animated is set', function (done) {
|
||||||
fs.createReadStream(fixtures.inputWebPAnimated)
|
fs.createReadStream(fixtures.inputWebPAnimated)
|
||||||
.pipe(sharp({ animated: true }))
|
.pipe(sharp({ animated: true }))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user