Index: trunk/phase3/RELEASE-NOTES-1.18 |
— | — | @@ -85,6 +85,8 @@ |
86 | 86 | * New hook "Collation::factory" to allow extensions to create custom |
87 | 87 | category collations. |
88 | 88 | * $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. |
89 | 91 | |
90 | 92 | === New features in 1.18 === |
91 | 93 | * BREAKING CHANGE: action=watch / action=unwatch now requires a token. |
Index: trunk/phase3/includes/Setup.php |
— | — | @@ -187,6 +187,11 @@ |
188 | 188 | ); |
189 | 189 | } |
190 | 190 | |
| 191 | +if ( is_null( $wgEnableAutoRotation ) ) { |
| 192 | + // Only enable auto-rotation when the bitmap handler can rotate |
| 193 | + $wgEnableAutoRotation = BitmapHandler::canRotate(); |
| 194 | +} |
| 195 | + |
191 | 196 | if ( $wgRCFilterByAge ) { |
192 | 197 | # # Trim down $wgRCLinkDays so that it only lists links which are valid |
193 | 198 | # # as determined by $wgRCMaxAge. |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -744,6 +744,12 @@ |
745 | 745 | /** Obsolete, always true, kept for compatibility with extensions */ |
746 | 746 | $wgUseImageResize = true; |
747 | 747 | |
| 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; |
748 | 754 | |
749 | 755 | /** |
750 | 756 | * Internal name of virus scanner. This servers as a key to the |
Index: trunk/phase3/includes/media/ExifBitmap.php |
— | — | @@ -162,6 +162,11 @@ |
163 | 163 | * @return int 0, 90, 180 or 270 |
164 | 164 | */ |
165 | 165 | public function getRotation( $file ) { |
| 166 | + global $wgEnableAutoRotation; |
| 167 | + if ( !$wgEnableAutoRotation ) { |
| 168 | + return 0; |
| 169 | + } |
| 170 | + |
166 | 171 | $data = $file->getMetadata(); |
167 | 172 | return $this->getRotationForExif( $data ); |
168 | 173 | } |