|
|
@ -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); |
|
|
|