PIL_PASTE update code.
This commit is contained in:
@ -70,16 +70,21 @@ abstract class Upload
|
|||||||
$size_parts = explode('x', $size);
|
$size_parts = explode('x', $size);
|
||||||
self::saveImage($image_variant, self::getFilePath($image), $size_parts[0] ? : null, $size_parts[1] ? : null);
|
self::saveImage($image_variant, self::getFilePath($image), $size_parts[0] ? : null, $size_parts[1] ? : null);
|
||||||
if (Config::get('PYTHON_PIL_PASTE') &&
|
if (Config::get('PYTHON_PIL_PASTE') &&
|
||||||
function_exists(array($image, 'getWatermark')) &&
|
method_exists($image, 'getWatermark') &&
|
||||||
$image->getWatermark($size)
|
$image->getWatermark($size)
|
||||||
) {
|
) {
|
||||||
$script_file_path = Config::get('PYTHON_PIL_PASTE')->script_file_path;
|
$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) : '';
|
$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();
|
||||||
passthru($script_file_path
|
$code = null;
|
||||||
. $pil_options
|
$command = $script_file_path
|
||||||
. ' ' . self::getFilePath($image_variant)
|
. $pil_options
|
||||||
. ' ' . Config::get('PATH_WEB_ROOT') . '/' . $image->getWatermark($size));
|
. ' ' . 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();
|
// ob_clean();
|
||||||
}
|
}
|
||||||
self::defineSizeWidthAndHeight($image_variant);
|
self::defineSizeWidthAndHeight($image_variant);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dimti/Image",
|
"name": "dimti/Image",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git@dimti.ru:lib/Image.git"
|
"url": "git@dimti.ru:lib/Image.git"
|
||||||
|
Reference in New Issue
Block a user