From 7648652d4538ba010b54ef84b5ce58928769f69a Mon Sep 17 00:00:00 2001 From: Alexander Demidov Date: Mon, 2 Dec 2013 16:37:32 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B2=20Python=20PIL=20=D1=83=D0=BA=D0=B0=D0=B7?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE?= =?UTF-8?q?=20=D0=BE=D0=B4=D0=BD=D0=BE=D0=B9=20=D0=B8=D0=B7=20=D1=81=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BE=D0=BD=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=B5?= =?UTF-8?q?=D1=81=D0=B0=D0=B9=D0=B7=D0=B8=D0=BD=D0=B3=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Upload.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Upload.class.php b/Upload.class.php index 7c67716..5b9ce88 100644 --- a/Upload.class.php +++ b/Upload.class.php @@ -67,9 +67,14 @@ abstract class Upload $image->variants[$size] = $image_variant; if (Config::get('PYTHON_PIL_RESIZE')) { $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(); - 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(); } }