summaryrefslogtreecommitdiff
path: root/includes/media/Bitmap.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /includes/media/Bitmap.php
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'includes/media/Bitmap.php')
-rw-r--r--includes/media/Bitmap.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php
index e81b37de..eadcf94b 100644
--- a/includes/media/Bitmap.php
+++ b/includes/media/Bitmap.php
@@ -142,7 +142,7 @@ class BitmapHandler extends TransformationalImageHandler {
$env['MAGICK_TMPDIR'] = $wgImageMagickTempDir;
}
- $rotation = $this->getRotation( $image );
+ $rotation = isset( $params['disableRotation'] ) ? 0 : $this->getRotation( $image );
list( $width, $height ) = $this->extractPreRotationDimensions( $params, $rotation );
$cmd = call_user_func_array( 'wfEscapeShellArg', array_merge(
@@ -169,10 +169,8 @@ class BitmapHandler extends TransformationalImageHandler {
array( $this->escapeMagickOutput( $params['dstPath'] ) ) ) );
wfDebug( __METHOD__ . ": running ImageMagick: $cmd\n" );
- wfProfileIn( 'convert' );
$retval = 0;
$err = wfShellExecWithStderr( $cmd, $retval, $env );
- wfProfileOut( 'convert' );
if ( $retval !== 0 ) {
$this->logErrorForExternalProcess( $retval, $err, $cmd );
@@ -204,7 +202,7 @@ class BitmapHandler extends TransformationalImageHandler {
/ ( $params['srcWidth'] + $params['srcHeight'] )
< $wgSharpenReductionThreshold
) {
- // Hack, since $wgSharpenParamater is written specifically for the command line convert
+ // Hack, since $wgSharpenParameter is written specifically for the command line convert
list( $radius, $sigma ) = explode( 'x', $wgSharpenParameter );
$im->sharpenImage( $radius, $sigma );
}
@@ -223,7 +221,7 @@ class BitmapHandler extends TransformationalImageHandler {
}
}
- $rotation = $this->getRotation( $image );
+ $rotation = isset( $params['disableRotation'] ) ? 0 : $this->getRotation( $image );
list( $width, $height ) = $this->extractPreRotationDimensions( $params, $rotation );
$im->setImageBackgroundColor( new ImagickPixel( 'white' ) );
@@ -280,10 +278,8 @@ class BitmapHandler extends TransformationalImageHandler {
$cmd = str_replace( '%h', wfEscapeShellArg( $params['physicalHeight'] ),
str_replace( '%w', wfEscapeShellArg( $params['physicalWidth'] ), $cmd ) ); # Size
wfDebug( __METHOD__ . ": Running custom convert command $cmd\n" );
- wfProfileIn( 'convert' );
$retval = 0;
$err = wfShellExecWithStderr( $cmd, $retval );
- wfProfileOut( 'convert' );
if ( $retval !== 0 ) {
$this->logErrorForExternalProcess( $retval, $err, $cmd );
@@ -344,7 +340,7 @@ class BitmapHandler extends TransformationalImageHandler {
$src_image = call_user_func( $loader, $params['srcPath'] );
- $rotation = function_exists( 'imagerotate' ) ? $this->getRotation( $image ) : 0;
+ $rotation = function_exists( 'imagerotate' ) && !isset( $params['disableRotation'] ) ? $this->getRotation( $image ) : 0;
list( $width, $height ) = $this->extractPreRotationDimensions( $params, $rotation );
$dst_image = imagecreatetruecolor( $width, $height );
@@ -457,10 +453,8 @@ class BitmapHandler extends TransformationalImageHandler {
" -rotate " . wfEscapeShellArg( "-$rotation" ) . " " .
wfEscapeShellArg( $this->escapeMagickOutput( $params['dstPath'] ) );
wfDebug( __METHOD__ . ": running ImageMagick: $cmd\n" );
- wfProfileIn( 'convert' );
$retval = 0;
$err = wfShellExecWithStderr( $cmd, $retval );
- wfProfileOut( 'convert' );
if ( $retval !== 0 ) {
$this->logErrorForExternalProcess( $retval, $err, $cmd );