fixes #2118 add config setting animated_webp_compression_quality (default=70)

This commit is contained in:
plegall
2024-02-19 17:17:28 +01:00
parent 4adf36f2e5
commit 1000ae868e
2 changed files with 7 additions and 1 deletions

View File

@@ -638,12 +638,14 @@ class image_ext_imagick implements imageInterface
function set_compression_quality($quality)
{
global $conf;
if ($this->is_animated_webp)
{
// in cas of animated WebP, we need to maximize quality to 70 to avoid
// heavy thumbnails (or square or whatever is displayed on the thumbnails
// page)
$quality = min($quality, 70);
$quality = min($quality, $conf['animated_webp_compression_quality']);
}
$this->add_command('quality', $quality);