mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure ratios are not swapped when rotating 90/270 and ignoring aspect
This commit is contained in:
@@ -35,6 +35,23 @@ describe('Rotation', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('Rotate by 270 degrees, square output ignoring aspect ratio', function(done) {
|
||||
sharp(fixtures.inputJpg)
|
||||
.resize(240, 240)
|
||||
.ignoreAspectRatio()
|
||||
.rotate(270)
|
||||
.toBuffer(function(err, data, info) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(240, info.width);
|
||||
assert.strictEqual(240, info.height);
|
||||
sharp(data).metadata(function(err, metadata) {
|
||||
assert.strictEqual(240, metadata.width);
|
||||
assert.strictEqual(240, metadata.height);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Input image has Orientation EXIF tag but do not rotate output', function(done) {
|
||||
sharp(fixtures.inputJpgWithExif)
|
||||
.resize(320)
|
||||
|
||||
Reference in New Issue
Block a user