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
@@ -102,6 +102,8 @@ describe('Image metadata', function () {
|
||||
assert.strictEqual(false, metadata.hasProfile);
|
||||
assert.strictEqual(false, metadata.hasAlpha);
|
||||
assert.strictEqual(1, metadata.orientation);
|
||||
assert.strictEqual(2464, metadata.autoOrient.width);
|
||||
assert.strictEqual(3248, metadata.autoOrient.height);
|
||||
assert.strictEqual('undefined', typeof metadata.exif);
|
||||
assert.strictEqual('undefined', typeof metadata.icc);
|
||||
assert.strictEqual('inch', metadata.resolutionUnit);
|
||||
@@ -148,6 +150,8 @@ describe('Image metadata', function () {
|
||||
assert.strictEqual(false, metadata.hasProfile);
|
||||
assert.strictEqual(false, metadata.hasAlpha);
|
||||
assert.strictEqual('undefined', typeof metadata.orientation);
|
||||
assert.strictEqual(2809, metadata.autoOrient.width);
|
||||
assert.strictEqual(2074, metadata.autoOrient.height);
|
||||
assert.strictEqual('undefined', typeof metadata.exif);
|
||||
assert.strictEqual('undefined', typeof metadata.icc);
|
||||
done();
|
||||
@@ -218,7 +222,11 @@ describe('Image metadata', function () {
|
||||
isPalette: false,
|
||||
isProgressive: false,
|
||||
space: 'b-w',
|
||||
width: 32
|
||||
width: 32,
|
||||
autoOrient: {
|
||||
width: 32,
|
||||
height: 32
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -239,7 +247,11 @@ describe('Image metadata', function () {
|
||||
isPalette: false,
|
||||
isProgressive: false,
|
||||
space: 'grey16',
|
||||
width: 32
|
||||
width: 32,
|
||||
autoOrient: {
|
||||
width: 32,
|
||||
height: 32
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -601,6 +613,10 @@ describe('Image metadata', function () {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(true, metadata.hasProfile);
|
||||
assert.strictEqual(8, metadata.orientation);
|
||||
assert.strictEqual(320, metadata.width);
|
||||
assert.strictEqual(240, metadata.height);
|
||||
assert.strictEqual(240, metadata.autoOrient.width);
|
||||
assert.strictEqual(320, metadata.autoOrient.height);
|
||||
assert.strictEqual('object', typeof metadata.exif);
|
||||
assert.strictEqual(true, metadata.exif instanceof Buffer);
|
||||
// EXIF
|
||||
@@ -926,7 +942,11 @@ describe('Image metadata', function () {
|
||||
pagePrimary: 0,
|
||||
compression: 'av1',
|
||||
hasProfile: false,
|
||||
hasAlpha: false
|
||||
hasAlpha: false,
|
||||
autoOrient: {
|
||||
width: 2048,
|
||||
height: 858
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user