From 9cb098bb0bd3fbece865466b76dfb347b7971665 Mon Sep 17 00:00:00 2001 From: manolino Date: Mon, 28 Aug 2017 14:34:42 -0400 Subject: [PATCH] Implements Jimp exitRotate() new method (jimp 0.2.28) to sove incoherent rotations when scaling images. --- src/image.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/image.js b/src/image.js index 9377757cf3..4d3be47e6f 100644 --- a/src/image.js +++ b/src/image.js @@ -37,6 +37,10 @@ image.resizeImage = function (data, callback) { var y = 0; var crop; + if (image._exif && image._exif.tags && image._exif.tags.Orientation) { + image.exifRotate(); + } + if (origRatio !== desiredRatio) { if (desiredRatio > origRatio) { desiredRatio = 1 / desiredRatio;