forked from Public/pics
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:
parent
909d50efa8
commit
8d02662eb3
@ -256,6 +256,9 @@ class Thumbnail
|
|||||||
if (!is_dir(THUMBSDIR . '/' . $this->image->getSubdir()))
|
if (!is_dir(THUMBSDIR . '/' . $this->image->getSubdir()))
|
||||||
mkdir(THUMBSDIR . '/' . $this->image->getSubdir(), 0755, true);
|
mkdir(THUMBSDIR . '/' . $this->image->getSubdir(), 0755, true);
|
||||||
|
|
||||||
|
// No need to preserve every detail.
|
||||||
|
$thumb->setImageCompressionQuality(80);
|
||||||
|
|
||||||
// Save it in a public spot.
|
// Save it in a public spot.
|
||||||
$thumb->writeImage(THUMBSDIR . '/' . $this->image->getSubdir() . '/' . $thumb_filename);
|
$thumb->writeImage(THUMBSDIR . '/' . $this->image->getSubdir() . '/' . $thumb_filename);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user