mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
Fix webp animation derivatives
Using imagick to generate derivates on an animated webp break animation Applying "-layers coalesce" ensure the animation remain smooth Refs : - https://github.com/ImageMagick/ImageMagick/issues/6375 - https://github.com/ImageMagick/ImageMagick/issues/5542 - https://github.com/ImageMagick/ImageMagick/issues/4246
This commit is contained in:
committed by
Pierrick Le Gall
parent
3293b329e9
commit
c616f17145
@@ -731,6 +731,12 @@ class image_ext_imagick implements imageInterface
|
||||
$exec = $this->imagickdir.pwg_image::get_ext_imagick_command();
|
||||
$exec .= ' "'.realpath($this->source_filepath).'"';
|
||||
|
||||
// If the image is animated webp add a filter to avoid breaking the animation
|
||||
if ($this->is_animated_webp)
|
||||
{
|
||||
$exec .= ' -layers coalesce ';
|
||||
}
|
||||
|
||||
foreach ($this->commands as $command => $params)
|
||||
{
|
||||
$exec .= ' -'.$command;
|
||||
@@ -739,7 +745,6 @@ class image_ext_imagick implements imageInterface
|
||||
$exec .= ' '.$params;
|
||||
}
|
||||
}
|
||||
|
||||
$dest = pathinfo($destination_filepath);
|
||||
$exec .= ' "'.realpath($dest['dirname']).'/'.$dest['basename'].'" 2>&1';
|
||||
$logger->debug($exec, 'i.php');
|
||||
|
||||
Reference in New Issue
Block a user