mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure autoOrient removes metadata after shrink-on-load #4431
This commit is contained in:
@@ -322,8 +322,6 @@ describe('Raw pixel data', function () {
|
||||
.gif({ keepDuplicateFrames: true })
|
||||
.toBuffer();
|
||||
|
||||
console.log(await sharp(gif).metadata());
|
||||
|
||||
const { width, height, pages, delay } = await sharp(gif).metadata();
|
||||
assert.strictEqual(width, 1);
|
||||
assert.strictEqual(height, 1);
|
||||
|
||||
@@ -635,6 +635,19 @@ describe('Rotation', function () {
|
||||
assert.strictEqual(height, 6);
|
||||
});
|
||||
|
||||
it('Shrink-on-load with autoOrient', async () => {
|
||||
const data = await sharp(fixtures.inputJpgWithLandscapeExif6)
|
||||
.resize(8)
|
||||
.autoOrient()
|
||||
.avif({ effort: 0 })
|
||||
.toBuffer();
|
||||
|
||||
const { width, height, orientation } = await sharp(data).metadata();
|
||||
assert.strictEqual(width, 8);
|
||||
assert.strictEqual(height, 6);
|
||||
assert.strictEqual(orientation, undefined);
|
||||
});
|
||||
|
||||
it('Invalid autoOrient throws', () =>
|
||||
assert.throws(
|
||||
() => sharp({ autoOrient: 'fail' }),
|
||||
|
||||
Reference in New Issue
Block a user