X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fmedia%2FJpeg.php;h=1feb3788d4a274e0654f5ef5f6fc3e688ea3fd08;hb=1bc950c1e19cebdfd404a87186fb209dbe722b2c;hp=8b5d65134277cda8c1130ffde938b490f9e80475;hpb=dc348e4df2e79a24e79b21ce265c8b0b481876bf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/Jpeg.php b/includes/media/Jpeg.php index 8b5d651342..1feb3788d4 100644 --- a/includes/media/Jpeg.php +++ b/includes/media/Jpeg.php @@ -32,7 +32,7 @@ */ class JpegHandler extends ExifBitmapHandler { - function getMetadata ( $image, $filename ) { + function getMetadata( $image, $filename ) { try { $meta = BitmapMetadataHandler::Jpeg( $filename ); if ( !is_array( $meta ) ) { @@ -69,18 +69,18 @@ class JpegHandler extends ExifBitmapHandler { public function rotate( $file, $params ) { global $wgJpegTran; - $rotation = ( $params[ 'rotation' ] + $this->getRotation( $file ) ) % 360; + $rotation = ( $params['rotation'] + $this->getRotation( $file ) ) % 360; - if( $wgJpegTran && is_file( $wgJpegTran ) ){ + if ( $wgJpegTran && is_file( $wgJpegTran ) ) { $cmd = wfEscapeShellArg( $wgJpegTran ) . " -rotate " . wfEscapeShellArg( $rotation ) . - " -outfile " . wfEscapeShellArg( $params[ 'dstPath' ] ) . - " " . wfEscapeShellArg( $params[ 'srcPath' ] ) . " 2>&1"; - wfDebug( __METHOD__ . ": running jpgtran: $cmd\n" ); - wfProfileIn( 'jpegtran' ); - $retval = 0; - $err = wfShellExec( $cmd, $retval, $env ); - wfProfileOut( 'jpegtran' ); + " -outfile " . wfEscapeShellArg( $params['dstPath'] ) . + " " . wfEscapeShellArg( $params['srcPath'] ) . " 2>&1"; + wfDebug( __METHOD__ . ": running jpgtran: $cmd\n" ); + wfProfileIn( 'jpegtran' ); + $retval = 0; + $err = wfShellExec( $cmd, $retval, $env ); + wfProfileOut( 'jpegtran' ); if ( $retval !== 0 ) { $this->logErrorForExternalProcess( $retval, $err, $cmd ); return new MediaTransformError( 'thumbnail_error', 0, 0, $err );