diff options
author | Gero Müller <post@geromueller.de> | 2018-03-13 03:33:36 +1000 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2018-03-12 10:33:36 -0700 |
commit | 5d908b4c70560873b4adf4bc32074d948d79c8d1 (patch) | |
tree | 4145b5c461eeaf667c52eaf690e263b4362b2252 | |
parent | 67da76e7f1e0f911c20d40f8e6c16052152b6f24 (diff) |
Add thumbnail quality parameter (default to 95)
-rw-r--r-- | app/Core/Thumbnail.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/Core/Thumbnail.php b/app/Core/Thumbnail.php index 733d3a3c..fbe14d1b 100644 --- a/app/Core/Thumbnail.php +++ b/app/Core/Thumbnail.php @@ -10,6 +10,7 @@ namespace Kanboard\Core; */ class Thumbnail { + protected $quality = 95; protected $metadata = array(); protected $srcImage; protected $dstImage; @@ -137,7 +138,7 @@ class Thumbnail */ public function toFile($filename) { - imagejpeg($this->dstImage, $filename); + imagejpeg($this->dstImage, $filename, $this->quality); imagedestroy($this->dstImage); imagedestroy($this->srcImage); return $this; @@ -152,7 +153,7 @@ class Thumbnail public function toString() { ob_start(); - imagejpeg($this->dstImage, null); + imagejpeg($this->dstImage, null, $this->quality); imagedestroy($this->dstImage); imagedestroy($this->srcImage); return ob_get_clean(); @@ -165,7 +166,7 @@ class Thumbnail */ public function toOutput() { - imagejpeg($this->dstImage, null); + imagejpeg($this->dstImage, null, $this->quality); imagedestroy($this->dstImage); imagedestroy($this->srcImage); } |