diff --git a/imagemagick.module b/imagemagick.module index 804338f..15151be 100644 --- a/imagemagick.module +++ b/imagemagick.module @@ -477,14 +477,13 @@ function _imagemagick_convert_exec($command_args, &$output = NULL, &$error = NUL ); if ($h = proc_open($command, $descriptors, $pipes, $drupal_path)) { $output = ''; - while (!feof($pipes[1])) { - $output .= fgets($pipes[1]); - } $error = ''; - while (!feof($pipes[2])) { + stream_set_blocking($pipes[1], FALSE); + stream_set_blocking($pipes[2], FALSE); + while (!feof($pipes[1]) && !feof($pipes[2])) { + $output .= fgets($pipes[1]); $error .= fgets($pipes[2]); } - fclose($pipes[0]); fclose($pipes[1]); fclose($pipes[2]);