Add autoOrient operation and constructor option #4144

This commit is contained in:
Don Denton
2024-07-03 10:34:54 -04:00
committed by Lovell Fuller
parent b7ff2645c4
commit 14c83e1f4c
137 changed files with 428 additions and 136 deletions

View File

@@ -138,6 +138,22 @@ describe('composite', () => {
fixtures.assertMaxColourDistance(actual, expected);
});
it('autoOrient', async () => {
const data = await sharp({
create: {
width: 600, height: 600, channels: 4, background: { ...red, alpha: 1 }
}
})
.composite([{
input: fixtures.inputJpgWithExif,
autoOrient: true
}])
.jpeg()
.toBuffer();
await fixtures.assertSimilar(fixtures.expected('composite-autoOrient.jpg'), data);
});
it('zero offset', done => {
sharp(fixtures.inputJpg)
.resize(80)