# HG changeset patch # User Dan # Date 1244821123 14400 # Node ID 1f55c324efcfaca17a6203aa6816d171802ea40e # Parent b8730fcd64a904df4fb5b328bdc93c57279a4845 Image tools: Use which() instead of reimplementing (should also work on win32 now) diff -r b8730fcd64a9 -r 1f55c324efcf imagetools.php --- a/imagetools.php Tue May 26 15:26:59 2009 -0400 +++ b/imagetools.php Fri Jun 12 11:38:43 2009 -0400 @@ -93,18 +93,9 @@ } // try to find convert in the PATH - // FIXME: unix specific (won't work on windows) - $path = ( isset($_ENV['PATH']) ) ? $_ENV['PATH'] : ( isset($_SERVER['PATH']) ? $_SERVER['PATH'] : '/usr/local/bin:/usr/bin:/bin' ); - $path = explode(':', $path); - foreach ( $path as $dir ) - { - if ( file_exists("$dir/convert") && is_executable("$dir/convert") ) - { - $magick_path = "$dir/convert"; - } - } + $magick_path = which('convert'); - $can_use_magick = isset($magick_path); + $can_use_magick = !empty($magick_path); $can_use_gd = ( function_exists('getimagesize') && function_exists('imagecreatetruecolor') &&