plg wrote:
What about using animated WebP instead of animated GIF ? WebP are superior in all possible ways (as compatible as GIF, lighter, higher quality)
The result with animated WebP is semi-successful :)
I made an animated WebP image with 3 frames and 3000 ms delay between them and uploaded it to my Piwigo gallery - https://terijoki.spb.ru/photos/picture. … egory/3448
What I see:
- all derivatives are static and show just first frame; SORRY, that's not true, actually, "small" derivatives (sizes 2s, xs, sm) show correctly with animation, but "large" me, la, xl and xx are static.
- the original file (if you select it from the size selection menu with icon on top left) shows correctly with animation;
- the thumbnail in the album view shows correctly with animation.
Alexandr
Last edited by abravorus (2025-01-26 11:35:21)
Offline
Hello.
I found a reason why I didn't see animation for WEBP animated images starting from some size.
I have watermark switched on in Piwigo settings. For my case watermark from PNG file is applied to the derivative if its' width or height => 500
If I delete "bigger" derivatives and (just for test) change the condition in i.php (line 548 or around):
from
if ($params->will_watermark($d_size))
to
if ($params->will_watermark($d_size) && strtolower($page['derivative_ext'])!==".webp")
and open some ('xl', for example) derivative image with PATH/i.php?/upload/YYYY/MM/DD/name-xl.webp
the animation from fresh derivative built without applying watermark works fine.
So, applying watermark "kills" somehow animation in WEBP derivatives. Probably by this function:
$image->compose($wm_image, $x, $y, $wm->opacity)
My config for graphic library:
$conf['graphics_library'] = 'ext_imagick';
External ImageMagick 6.9.11-60
Alexandr
Offline