From: Antoine Musso Date: Fri, 1 Jul 2011 18:34:50 +0000 (+0000) Subject: throw an exception on !is_executable( $wgExiv2Command ) X-Git-Tag: 1.31.0-rc.0~29122 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=cde767dd894c2b878e8dcf0957ed1d8688002762;p=lhc%2Fweb%2Fwiklou.git throw an exception on !is_executable( $wgExiv2Command ) --- diff --git a/tests/phpunit/includes/api/RandomImageGenerator.php b/tests/phpunit/includes/api/RandomImageGenerator.php index 639bca4ec0..162f1e8253 100644 --- a/tests/phpunit/includes/api/RandomImageGenerator.php +++ b/tests/phpunit/includes/api/RandomImageGenerator.php @@ -281,6 +281,10 @@ class RandomImageGenerator { // because the above setImageOrientation call doesn't work... nor can I get an external imagemagick binary to do this either... // hacking this for now (only works if you have exiv2 installed, a program to read and manipulate exif) if ( $wgExiv2Command ) { + # Make sure we have exiv2 command + if( !is_executable( $wgExiv2Command ) ) { + throw new MWException( __METHOD__ . ": '$wgExiv2Command' not found or not executable\n" ); + } $cmd = wfEscapeShellArg( $wgExiv2Command ) . " -M " . wfEscapeShellArg( "set Exif.Image.Orientation " . $orientation['exifCode'] )