This commit is contained in:
Kevin LEVRON
2014-01-31 08:56:08 +01:00
parent ff521fd7e0
commit 0034b3c1bd

View File

@ -14,6 +14,7 @@ use Imagine\Image\ImageInterface;
use Imagine\Image\ImagineInterface; use Imagine\Image\ImagineInterface;
use Imagine\Image\ManipulatorInterface; use Imagine\Image\ManipulatorInterface;
use Imagine\Image\Point; use Imagine\Image\Point;
use Imagine\Image\Palette\RGB;
use yii\base\InvalidConfigException; use yii\base\InvalidConfigException;
use yii\base\InvalidParamException; use yii\base\InvalidParamException;
use yii\helpers\ArrayHelper; use yii\helpers\ArrayHelper;
@ -155,7 +156,8 @@ class BaseImage
$img = $img->thumbnail($box, $mode); $img = $img->thumbnail($box, $mode);
// create empty image to preserve aspect ratio of thumbnail // create empty image to preserve aspect ratio of thumbnail
$thumb = static::getImagine()->create($box); $color = (new RGB())->color('#FFF', 100);
$thumb = static::getImagine()->create($box, $color);
// calculate points // calculate points
$size = $img->getSize(); $size = $img->getSize();