Don't blow up thumbnails if the image is smaller than 300x300.
This commit is contained in:
parent
258fc4b6ba
commit
4304b956dd
1 changed files with 1 additions and 1 deletions
|
@ -133,9 +133,9 @@ class UploadsContext {
|
||||||
$imagick->setImageFormat('jpg');
|
$imagick->setImageFormat('jpg');
|
||||||
$imagick->setImageCompressionQuality($this->config->getInteger('thumb:quality', 80));
|
$imagick->setImageCompressionQuality($this->config->getInteger('thumb:quality', 80));
|
||||||
|
|
||||||
$thumbRes = $this->config->getInteger('thumb:dimensions', 300);
|
|
||||||
$width = $imagick->getImageWidth();
|
$width = $imagick->getImageWidth();
|
||||||
$height = $imagick->getImageHeight();
|
$height = $imagick->getImageHeight();
|
||||||
|
$thumbRes = min($this->config->getInteger('thumb:dimensions', 300), $width, $height);
|
||||||
|
|
||||||
if($width === $height) {
|
if($width === $height) {
|
||||||
$resizeWidth = $resizeHeight = $thumbRes;
|
$resizeWidth = $resizeHeight = $thumbRes;
|
||||||
|
|
Loading…
Reference in a new issue