mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 22:32:40 +08:00
Fixes #2204
This commit is contained in:
@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user