r99910 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99909‎ | r99910 | r99911 >
Date:20:30, 15 October 2011
Author:btongminh
Status:ok (Comments)
Tags:
Comment:
Per r97671, add $wgEnableAutoRotation setting that can be used to explicitly disable auto-rotation.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.18 (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Setup.php (modified) (history)
  • /trunk/phase3/includes/media/ExifBitmap.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.18
@@ -85,6 +85,8 @@
8686 * New hook "Collation::factory" to allow extensions to create custom
8787 category collations.
8888 * $wgGroupPermissions now supports per namespace permissions.
 89+* $wgEnableAutoRotation enables or disables auto-rotation. Leaving it set to
 90+ null will cause MediaWiki to determine if auto-rotation is available.
8991
9092 === New features in 1.18 ===
9193 * BREAKING CHANGE: action=watch / action=unwatch now requires a token.
Index: trunk/phase3/includes/Setup.php
@@ -187,6 +187,11 @@
188188 );
189189 }
190190
 191+if ( is_null( $wgEnableAutoRotation ) ) {
 192+ // Only enable auto-rotation when the bitmap handler can rotate
 193+ $wgEnableAutoRotation = BitmapHandler::canRotate();
 194+}
 195+
191196 if ( $wgRCFilterByAge ) {
192197 # # Trim down $wgRCLinkDays so that it only lists links which are valid
193198 # # as determined by $wgRCMaxAge.
Index: trunk/phase3/includes/DefaultSettings.php
@@ -744,6 +744,12 @@
745745 /** Obsolete, always true, kept for compatibility with extensions */
746746 $wgUseImageResize = true;
747747
 748+/**
 749+ * If set to true, images that contain certain the exif orientation tag will
 750+ * be rotated accordingly. If set to null, try to auto-detect whether a scaler
 751+ * is available that can rotate.
 752+ */
 753+$wgEnableAutoRotation = null;
748754
749755 /**
750756 * Internal name of virus scanner. This servers as a key to the
Index: trunk/phase3/includes/media/ExifBitmap.php
@@ -162,6 +162,11 @@
163163 * @return int 0, 90, 180 or 270
164164 */
165165 public function getRotation( $file ) {
 166+ global $wgEnableAutoRotation;
 167+ if ( !$wgEnableAutoRotation ) {
 168+ return 0;
 169+ }
 170+
166171 $data = $file->getMetadata();
167172 return $this->getRotationForExif( $data );
168173 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r100840REL1_18: MFT r98426, r99371, r99632, r99897, r99910, r99914, r999952reedy18:47, 26 October 2011
r102751(follow-up r99910) Make $wgEnableAutoRotation work...bawolff04:09, 11 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97671* (bug 6672, 31024) Fixes for handling of images with an EXIF orientation...brion22:13, 20 September 2011

Comments

#Comment by Reedy (talk | contribs)   23:19, 25 October 2011

Does this want 1.18wmf1'ing aswell?

#Comment by MarkAHershberger (talk | contribs)   15:50, 14 November 2011

Since the default is "no rotation" and we pushed 1.18 with rotation, I think so.

#Comment by Bryan (talk | contribs)   17:23, 14 November 2011

Not required, unless communities choose to disable it.

Status & tagging log