Set JPEG compression to 80 for thumbnails.

This saves both disk space and bandwidth by compromising a little on quality.
Only thumbnails are affected; full-size images are still saved in full detail.
This commit is contained in:
Aaron van Geffen 2020-03-22 22:56:53 +01:00
parent 909d50efa8
commit 8d02662eb3
1 changed files with 3 additions and 0 deletions

View File

@ -256,6 +256,9 @@ class Thumbnail
if (!is_dir(THUMBSDIR . '/' . $this->image->getSubdir()))
mkdir(THUMBSDIR . '/' . $this->image->getSubdir(), 0755, true);
// No need to preserve every detail.
$thumb->setImageCompressionQuality(80);
// Save it in a public spot.
$thumb->writeImage(THUMBSDIR . '/' . $this->image->getSubdir() . '/' . $thumb_filename);