Browse Source

Добавление поддержки в Python PIL указание только одной из сторон для ресайзинга.

master
Alexander Demidov 11 years ago
parent
commit
7648652d45
  1. 9
      Upload.class.php

9
Upload.class.php

@ -67,9 +67,14 @@ abstract class Upload
$image->variants[$size] = $image_variant; $image->variants[$size] = $image_variant;
if (Config::get('PYTHON_PIL_RESIZE')) { if (Config::get('PYTHON_PIL_RESIZE')) {
$script_file_path = Config::get('PYTHON_PIL_RESIZE')->script_file_path; $script_file_path = Config::get('PYTHON_PIL_RESIZE')->script_file_path;
$pil_options = isset(Config::get('PYTHON_PIL_RESIZE')->pil_options) ? implode(' ', Config::get('PYTHON_PIL_RESIZE')->pil_options) . ' ' : '';
$pil_options = isset(Config::get('PYTHON_PIL_RESIZE')->pil_options) ? ' ' . implode(' ', Config::get('PYTHON_PIL_RESIZE')->pil_options) : '';
ob_start(); ob_start();
exec($script_file_path . ' --width=' . $size_parts[0] . ' --height=' . $size_parts[1] . ' ' . $pil_options . self::getFilePath($image) . ' ' . self::getFilePath($image_variant));
exec($script_file_path
. (($size_parts[0])?' --width=' . $size_parts[0]:'')
. (($size_parts[1])?' --height=' . $size_parts[1]:'')
. $pil_options
. ' ' . self::getFilePath($image)
. ' ' . self::getFilePath($image_variant));
ob_clean(); ob_clean();
} }
} }

Loading…
Cancel
Save