Ensure ratios are not swapped when rotating 90/270 and ignoring aspect

This commit is contained in:
Lovell Fuller
2016-03-28 22:40:37 +01:00
parent e576165cf1
commit 25b63a2fb4
3 changed files with 25 additions and 2 deletions

View File

@@ -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)