mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-24 08:13:38 +00:00
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:
parent
132049976a
commit
f2f36376cf
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue