diff --git a/File.php b/File.php index 93f00f6..c661b69 100644 --- a/File.php +++ b/File.php @@ -80,14 +80,14 @@ abstract class File * @param $force_create bool * @return ImageVariant */ - public function getImageVariant($size, $force_create = false) + public function getImageVariant($size, $force_create = false, $important_create = false) { /** * @var $this Image */ - if (!array_key_exists($size, $this->variants)) { + if (!array_key_exists($size, $this->variants) || $important_create) { $original_file_path = \Majestic\Config::get('PATH_WEB_ROOT') . '/' . $this->getWebName(); - if ($force_create && $this->getIsNoEmpty() && file_exists($original_file_path)) { + if (($important_create && $this->getIsNoEmpty() && file_exists($original_file_path)) || ($force_create && $this->getIsNoEmpty() && file_exists($original_file_path))) { Upload::imageVariant($this, $size); } else { $this->variants[$size] = new ImageVariant();