From f2f36376cffda33cf5f9e15ebd7b42b9b8da55c4 Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Mon, 6 Jan 2014 11:32:40 -0800 Subject: [PATCH] Fix image bucketing resize engine targetWidth was switched to even if the image was way smaller than it, fixed by only changing to it if the image is too big (too-small images should never be stretched anyway). Change-Id: I9e3e6a358e53dbed988b730205a8afec1dbf3483 --- resources/ext.multimediaViewer/ext.multimediaViewer.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/ext.multimediaViewer/ext.multimediaViewer.js b/resources/ext.multimediaViewer/ext.multimediaViewer.js index 6e5c14504..02c87505f 100755 --- a/resources/ext.multimediaViewer/ext.multimediaViewer.js +++ b/resources/ext.multimediaViewer/ext.multimediaViewer.js @@ -345,7 +345,9 @@ innerInfo = imageInfo.imageinfo[0]; image.onload = function () { - image.width = targetWidth; + if ( image.width > targetWidth ) { + image.width = targetWidth; + } viewer.profileEnd( rpid ); ui.replaceImageWith( image ); this.updateControls(); @@ -692,7 +694,10 @@ viewer.profileEnd( mdpid ); imageEle.onload = function () { - imageEle.width = targetWidth; + if ( imageEle.width > targetWidth ) { + imageEle.width = targetWidth; + } + viewer.profileEnd( pid ); viewer.lightbox.iface.replaceImageWith( imageEle );