http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97672
Revision: 97672
Author: brion
Date: 2011-09-20 22:25:54 +0000 (Tue, 20 Sep 2011)
Log Message:
-----------
* (bug 31048) Fix for width/height reported on Special:Upload thumbnail for
EXIF-rotated images
Followup to r79867: switch the reported width/height as well as rotating the
thumbnail image. This matches the logical width/height later seen when we
complete the upload.
Modified Paths:
--------------
trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js
Modified: trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js
===================================================================
--- trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js
2011-09-20 22:13:34 UTC (rev 97671)
+++ trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js
2011-09-20 22:25:54 UTC (rev 97672)
@@ -83,7 +83,7 @@
}
img.onload = function() {
- var width, height, x, y, dx, dy;
+ var width, height, x, y, dx, dy, logicalWidth,
logicalHeight;
// Fit the image within the
previewSizexpreviewSize box
if ( img.width > img.height ) {
width = previewSize;
@@ -103,19 +103,27 @@
case 0:
x = dx;
y = dy;
+ logicalWidth = img.width;
+ logicalHeight = img.height;
break;
case 90:
x = dx;
y = dy - previewSize;
+ logicalWidth = img.height;
+ logicalHeight = img.width;
break;
case 180:
x = dx - previewSize;
y = dy - previewSize;
+ logicalWidth = img.width;
+ logicalHeight = img.height;
break;
case 270:
x = dx - previewSize;
y = dy;
+ logicalWidth = img.height;
+ logicalHeight = img.width;
break;
}
@@ -124,7 +132,7 @@
ctx.drawImage( img, x, y, width, height );
// Image size
- var info = mw.msg( 'widthheight', img.width,
img.height ) +
+ var info = mw.msg( 'widthheight', logicalWidth,
logicalHeight ) +
', ' + prettySize( file.size );
$( '#mw-upload-thumbnail .fileinfo' ).text(
info );
};
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs