X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fmedia%2FBitmap.php;h=7f108c86638c134f043da79b7a9e01512c7b1dd2;hb=f726bbf6e7f26cd268e6c44a4af675c15a337921;hp=eeb8078715a486e8fd9e098b9a345f45e66fd045;hpb=43dd99d2017b61bc36ec2e285f41a786ab173e88;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index eeb8078715..7f108c8663 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -187,7 +187,9 @@ class BitmapHandler extends ImageHandler { wfHostname(), $image->getName() ) ); return new MediaTransformError( 'thumbnail_error', - $scalerParams['clientWidth'], $scalerParams['clientHeight'] ); + $scalerParams['clientWidth'], $scalerParams['clientHeight'], + wfMessage( 'filemissing' )->text() + ); } # Try a hook @@ -227,7 +229,9 @@ class BitmapHandler extends ImageHandler { } elseif ( $removed ) { # Thumbnail was zero-byte and had to be removed return new MediaTransformError( 'thumbnail_error', - $scalerParams['clientWidth'], $scalerParams['clientHeight'] ); + $scalerParams['clientWidth'], $scalerParams['clientHeight'], + wfMessage( 'unknown-error' )->text() + ); } elseif ( $mto ) { return $mto; } else { @@ -753,6 +757,21 @@ class BitmapHandler extends ImageHandler { } } + /** + * @see $wgEnableAutoRotation + * @return bool Whether auto rotation is enabled + */ + public static function autoRotateEnabled() { + global $wgEnableAutoRotation; + + if ( $wgEnableAutoRotation === null ) { + // Only enable auto-rotation when the bitmap handler can rotate + $wgEnableAutoRotation = BitmapHandler::canRotate(); + } + + return $wgEnableAutoRotation; + } + /** * @param File $file * @param array $params Rotate parameters.