From: Roan Kattouw Date: Wed, 24 Nov 2010 22:50:46 +0000 (+0000) Subject: Fix strange bug in ImageMagick call: if $params['comment'] was set to '' (which is... X-Git-Tag: 1.31.0-rc.0~33741 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=f73704c36b101b66844dea6ff1d224318436d330;p=lhc%2Fweb%2Fwiklou.git Fix strange bug in ImageMagick call: if $params['comment'] was set to '' (which is explicitly done by the code in certain cases), the command line will contain -set comment -depth 8, causing the comment to be set to '-depth' and the file '8' to be read. Fix this by not adding the -set comment part at all if the comment is empty --- diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index c28e7eb9ce..bb1bbbaf43 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -238,8 +238,10 @@ class BitmapHandler extends ImageHandler { // or ImageMagick may decide your ratio is wrong and slice off // a pixel. " -thumbnail " . wfEscapeShellArg( "{$params['physicalDimensions']}!" ) . - // Add the source url as a comment to the thumb. - " -set comment " . wfEscapeShellArg( $this->escapeMagickProperty( $params['comment'] ) ) . + // Add the source url as a comment to the thumb, but don't add the flag if there's no comment + $params['comment'] !== '' + ? " -set comment " . wfEscapeShellArg( $this->escapeMagickProperty( $params['comment'] ) ) + : '' . " -depth 8 $sharpen" . " {$animation_post} " . wfEscapeShellArg( $this->escapeMagickOutput( $params['dstPath'] ) ) . " 2>&1";