mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add autoOrient operation and constructor option #4144
This commit is contained in:
committed by
Lovell Fuller
parent
b7ff2645c4
commit
14c83e1f4c
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user