Ensure ops without multi-page support reject (#3010)

This commit is contained in:
Lovell Fuller
2021-12-12 09:14:26 +00:00
committed by GitHub
parent 5bb6702717
commit 9755629cfd
5 changed files with 81 additions and 1 deletions

View File

@@ -272,6 +272,34 @@ describe('Rotation', function () {
});
});
it('Animated image rotate-then-extract rejects', () =>
assert.rejects(() => sharp(fixtures.inputGifAnimated, { animated: true })
.rotate(1)
.extract({
top: 1,
left: 1,
width: 10,
height: 10
})
.toBuffer(),
/Rotate is not supported for multi-page images/
)
);
it('Animated image extract-then-rotate rejects', () =>
assert.rejects(() => sharp(fixtures.inputGifAnimated, { animated: true })
.extract({
top: 1,
left: 1,
width: 10,
height: 10
})
.rotate(1)
.toBuffer(),
/Rotate is not supported for multi-page images/
)
);
it('Flip - vertical', function (done) {
sharp(fixtures.inputJpg)
.resize(320)