diff --git a/Upload.class.php b/Upload.class.php index 6ae8567..19ba277 100644 --- a/Upload.class.php +++ b/Upload.class.php @@ -70,16 +70,21 @@ abstract class Upload $size_parts = explode('x', $size); self::saveImage($image_variant, self::getFilePath($image), $size_parts[0] ? : null, $size_parts[1] ? : null); if (Config::get('PYTHON_PIL_PASTE') && - function_exists(array($image, 'getWatermark')) && + method_exists($image, 'getWatermark') && $image->getWatermark($size) ) { $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(); - passthru($script_file_path - . $pil_options - . ' ' . self::getFilePath($image_variant) - . ' ' . Config::get('PATH_WEB_ROOT') . '/' . $image->getWatermark($size)); + $code = null; + $command = $script_file_path + . $pil_options + . ' ' . self::getFilePath($image_variant) + . ' ' . Config::get('PATH_WEB_ROOT') . '/' . $image->getWatermark($size); + passthru($command, $code); + if ($code !== 0) { + throw new ErrorException('Command PYTHON_PIL_RESIZE: ' . $command ); + } // ob_clean(); } self::defineSizeWidthAndHeight($image_variant); diff --git a/composer.json b/composer.json index 8809e07..407ad73 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "dimti/Image", - "version": "0.1.0", + "version": "0.1.1", "dist": { "type": "git", "url": "git@dimti.ru:lib/Image.git"