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
This commit is contained in:
Mark Holmquist 2014-01-06 11:32:40 -08:00
parent 132049976a
commit f2f36376cf

View file

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