User "Krinkle" posted a comment on MediaWiki.r80775.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/80775#c21395
Commit summary:

Follow-up r79867: Read out EXIF orientation in JavaScript and rotate 
accordingly. Added JsJpegMeta library by Ben Leslie under the MIT license.

* Added JS variabele wgFileCanRotate. If anybody knows a way to make certain 
variables only available to certain modules, please tell me, could not find it.
* Added JsJpegMeta as mediawiki.util.jpegmeta
* Made BitmapHandler::getScaler and BitmapHandker::canRotate static
* Bumped style version

Comment:

<blockquote><em>+       this.JpegMeta = JpegMeta; // I have no clue why I need 
this magic... -- Bryan</em></blockquote>

I stumbled across this today, here's the answer:
* The simple answer, later in the code it refers to this.JpegMeta when 
declaring new properties. So that's why it's needed there. That need could be 
removed by replacing uses of <code>this.JpegMeta</code> with 
<code>JpegMeta</code> (the local variable)
* So what's "this" referring to here anyway ? It's referring to the global 
<code>window</code> object. So it's actually declaring 
<code>window.JpegMeta</code> (at least for us that's what it's doing). We 
probably don't want that, since we're putting it into mw.libs.jpegmeta.

I would suggest that we:
* Remove this.JpegMeta, so that we no longer have it as a global variable
* Keep the scrip functional by replacing uses of <code>this.JpegMeta</code> 
with <code>JpegMeta</code> (which is a general good practice and should be 
offered upstream)

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to