mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-01 20:04:51 +02:00
issue #2411 cap JPEG quality at 75 for 3XL/4XL derivatives
This commit is contained in:
@@ -598,7 +598,14 @@ if ($d_size[0]*$d_size[1] < $conf['derivatives_strip_metadata_threshold'])
|
||||
$image->strip();
|
||||
}
|
||||
|
||||
$image->set_compression_quality( ImageStdParams::$quality );
|
||||
$compression_quality = ImageStdParams::$quality;
|
||||
|
||||
// for big sizing never go beyond 75 quality
|
||||
if (in_array($page['derivative_type'], [IMG_4XLARGE, IMG_3XLARGE]))
|
||||
{
|
||||
$compression_quality = min(ImageStdParams::$quality, 75);
|
||||
}
|
||||
|
||||
$image->write( $page['derivative_path'] );
|
||||
$image->destroy();
|
||||
@chmod($page['derivative_path'], 0644);
|
||||
@@ -618,5 +625,6 @@ if ($logger->severity() >= Logger::DEBUG)
|
||||
'd_size' => $d_size[0] . ' ' . $d_size[1] . ' ' . ($d_size[0]*$d_size[1]),
|
||||
'mem_usage' => function_exists('memory_get_peak_usage') ? round( memory_get_peak_usage()/(1024*1024), 1) : '',
|
||||
'timing' => $timing,
|
||||
'quality' => $compression_quality,
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user