diff --git a/Upload.class.php b/Upload.class.php index f1ac869..de3d3d5 100644 --- a/Upload.class.php +++ b/Upload.class.php @@ -75,17 +75,17 @@ abstract class Upload ) { $script_file_path = Config::get('PYTHON_PIL_PASTE')->script_file_path; $pil_options = (isset(Config::get('PYTHON_PIL_PASTE')->pil_options) && Config::get('PYTHON_PIL_PASTE')->pil_options) ? ' ' . implode(' ', Config::get('PYTHON_PIL_PASTE')->pil_options) : ''; -// ob_start(); + ob_start(); $code = null; $command = $script_file_path . $pil_options . ' ' . self::getFilePath($image_variant) . ' ' . Config::get('PATH_WEB_ROOT') . '/' . $image->getWatermark($size); - passthru($command, $code); + passthru('exec 2>&1; ' . $command, $code); if ($code !== 0) { - throw new ErrorException('Command PYTHON_PIL_RESIZE: ' . $command ); + throw new ErrorException('Command PYTHON_PIL_PASTE exit with code "' . $code . '": ' . $command . PHP_EOL . 'Std out: ' . ob_get_clean() ); } -// ob_clean(); + ob_end_clean(); } self::defineSizeWidthAndHeight($image_variant); $image->variants[$size] = $image_variant; @@ -134,7 +134,7 @@ abstract class Upload if ($code !== 0) { throw new ErrorException('Command PYTHON_PIL_RESIZE exit with code "' . $code . '": ' . $command . PHP_EOL . 'Std out: ' . ob_get_clean() ); } - ob_clean(); + ob_end_clean(); } else { if ($width || $height) { if (!(ImageVariant::getIsClass($image)) && Image::getIsSubClass($image)) {