From df1207bd3e80bd524d70342c84f6cc9d82f1b689 Mon Sep 17 00:00:00 2001 From: Alexander Demidov Date: Fri, 4 Oct 2013 17:47:49 +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=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=20$fo?= =?UTF-8?q?rce=5Fcreate=20=D0=B2=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20File.g?= =?UTF-8?q?etImageVariant().=20=D0=97=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=BE-=D1=83=D0=BC=D0=BE=D0=BB=D1=87=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=8E=20-=20false.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- File.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/File.class.php b/File.class.php index b977888..2644a24 100644 --- a/File.class.php +++ b/File.class.php @@ -64,15 +64,16 @@ abstract class File /** * @param $size string + * @param $force_create bool * @return ImageVariant */ - public function getImageVariant($size) + public function getImageVariant($size, $force_create = false) { /** * @var $this Image */ if (!array_key_exists($size, $this->variants)) { - if ($this->getIsNoEmpty()) { + if ($force_create && $this->getIsNoEmpty()) { Upload::imageVariant($this, $size); } else { $this->variants[$size] = new ImageVariant();