|
|
@ -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(); |
|
|
|