Browse Source

Fixes #2204

tags/2.0.0-beta
Kevin LEVRON 11 years ago
parent
commit
0034b3c1bd
  1. 4
      extensions/imagine/BaseImage.php

4
extensions/imagine/BaseImage.php

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

Loading…
Cancel
Save