Remove metadata from medium-photos and thumbs + Reduce quality of medium-photos #556
This commit is contained in:
parent
57acac71da
commit
55628f1f56
@ -314,6 +314,9 @@ final class Photo {
|
|||||||
$thumb->setImageCompressionQuality($quality);
|
$thumb->setImageCompressionQuality($quality);
|
||||||
$thumb->setImageFormat('jpeg');
|
$thumb->setImageFormat('jpeg');
|
||||||
|
|
||||||
|
// Remove metadata to save some bytes
|
||||||
|
$thumb->stripImage();
|
||||||
|
|
||||||
// Copy image for 2nd thumb version
|
// Copy image for 2nd thumb version
|
||||||
$thumb2x = clone $thumb;
|
$thumb2x = clone $thumb;
|
||||||
|
|
||||||
@ -394,6 +397,9 @@ final class Photo {
|
|||||||
// Call plugins
|
// Call plugins
|
||||||
Plugins::get()->activate(__METHOD__, 0, func_get_args());
|
Plugins::get()->activate(__METHOD__, 0, func_get_args());
|
||||||
|
|
||||||
|
// Quality of medium-photo
|
||||||
|
$quality = 90;
|
||||||
|
|
||||||
// Set to true when creation of medium-photo failed
|
// Set to true when creation of medium-photo failed
|
||||||
$error = false;
|
$error = false;
|
||||||
|
|
||||||
@ -426,6 +432,8 @@ final class Photo {
|
|||||||
|
|
||||||
// Adjust image
|
// Adjust image
|
||||||
$medium->scaleImage($newWidth, $newHeight, true);
|
$medium->scaleImage($newWidth, $newHeight, true);
|
||||||
|
$medium->stripImage();
|
||||||
|
$medium->setImageCompressionQuality($quality);
|
||||||
|
|
||||||
// Save image
|
// Save image
|
||||||
try { $medium->writeImage($newUrl); }
|
try { $medium->writeImage($newUrl); }
|
||||||
|
Loading…
Reference in New Issue
Block a user