Browse Source

PIL_PASTE update code.

master
Alexander Demidov 11 years ago
parent
commit
092bdb4f71
  1. 15
      Upload.class.php
  2. 2
      composer.json

15
Upload.class.php

@ -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
. $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(); // ob_clean();
} }
self::defineSizeWidthAndHeight($image_variant); self::defineSizeWidthAndHeight($image_variant);

2
composer.json

@ -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"

Loading…
Cancel
Save