From 6853a0436635f2bce068dc0fb41f406918a83f1c Mon Sep 17 00:00:00 2001 From: Ramil Valitov Date: Tue, 23 Oct 2018 03:24:21 +0300 Subject: [PATCH] [fix] correct scaling --- src/main/webapp/js/ImageUploader.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/js/ImageUploader.js b/src/main/webapp/js/ImageUploader.js index a62f873..05377e6 100644 --- a/src/main/webapp/js/ImageUploader.js +++ b/src/main/webapp/js/ImageUploader.js @@ -77,6 +77,10 @@ ImageUploader.prototype.handleFileSelection = function(file, completionCallback) This.scaleImage(img, completionCallback); } } + else{ + //No rotation, just scale the image + This.scaleImage(img, completionCallback); + } } }; reader.readAsDataURL(file); @@ -172,8 +176,8 @@ ImageUploader.prototype.scaleImage = function(img, completionCallback, orientati //Let's find the max available width for scaled image var ratio = canvas.width/canvas.height; var mWidth = Math.min(this.config.maxWidth, ratio*this.config.maxHeight); - if ( (this.config.maxSize>0) && (this.config.maxSize0) && (this.config.maxSize