Per r97671, add $wgEnableAutoRotation setting that can be used to explicitly disable...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 15 Oct 2011 20:30:37 +0000 (20:30 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 15 Oct 2011 20:30:37 +0000 (20:30 +0000)
RELEASE-NOTES-1.18
includes/DefaultSettings.php
includes/Setup.php
includes/media/ExifBitmap.php

index 1885494..074ff90 100644 (file)
@@ -85,6 +85,8 @@ production.
 * New hook "Collation::factory" to allow extensions to create custom
   category collations.
 * $wgGroupPermissions now supports per namespace permissions.
+* $wgEnableAutoRotation enables or disables auto-rotation. Leaving it set to
+  null will cause MediaWiki to determine if auto-rotation is available.
 
 === New features in 1.18 ===
 * BREAKING CHANGE: action=watch / action=unwatch now requires a token.
index 3317428..a888c3a 100644 (file)
@@ -744,6 +744,12 @@ $wgShowArchiveThumbnails = true;
 /** Obsolete, always true, kept for compatibility with extensions */
 $wgUseImageResize = true;
 
+/**
+ * If set to true, images that contain certain the exif orientation tag will
+ * be rotated accordingly. If set to null, try to auto-detect whether a scaler
+ * is available that can rotate.
+ */
+$wgEnableAutoRotation = null;
 
 /**
  * Internal name of virus scanner. This servers as a key to the
index 4682994..afde02f 100644 (file)
@@ -187,6 +187,11 @@ if ( $wgUseInstantCommons ) {
        );
 }
 
+if ( is_null( $wgEnableAutoRotation ) ) {
+       // Only enable auto-rotation when the bitmap handler can rotate
+       $wgEnableAutoRotation = BitmapHandler::canRotate();
+}
+
 if ( $wgRCFilterByAge ) {
        # # Trim down $wgRCLinkDays so that it only lists links which are valid
        # # as determined by $wgRCMaxAge.
index 6b4bf7a..96f5d21 100644 (file)
@@ -162,6 +162,11 @@ class ExifBitmapHandler extends BitmapHandler {
         * @return int 0, 90, 180 or 270
         */
        public function getRotation( $file ) {
+               global $wgEnableAutoRotation;
+               if ( !$wgEnableAutoRotation ) {
+                       return 0;
+               }
+               
                $data = $file->getMetadata();
                return $this->getRotationForExif( $data );
        }