Fixed webp gif animation lost on upload

Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.0 Beta 3).

Change log:
Do not overwrite uploaded images when optimization fails and there are no other pending changes
There may be a delay before changes are rolled out to the XenForo Community.
 
This is kind of subtle. We don't actually attempt WebP conversion for GIFs when using the GD image driver due to its lack of support for GIFs/animated WebP. However, it was being loaded into GD and saved back afterwards anyway, which caused the animation to be lost.

Note that GIFs which exceed the maximum dimensions will still lose their animation when resized with the GD image driver, which is unavoidable (and happens even in XF 2.2). Using Imagick should retain the animation (and convert to animated WebP, where enabled and supported).
 
If you paste or upload a gif, the webp image does not honor the animation.

Repro step on XF website:
Make meme: https://imgflip.com/gif-maker/171218846/Oprah-You-Get-A-Car
Paste into XF editor
Post Thread.

Meme animation is now lost :(

I upgraded to 2.3 this week and still seeing this. In fact, if I copy and paste a GIF on here, it loses it's animation;

1726133943491.webp

Is this expected behaviour?

[Edit] To clarify, its only when you copy/paste. It's like the copy and paste is pulling the gif into the clipboard as a webp already.
 
Last edited:
I can reproduce that, but the issue is Chrome seems to copy the image as a PNG regardless of the original type so that's what we receive when it's pasted so that will be a browser issue.
 
I can reproduce that, but the issue is Chrome seems to copy the image as a PNG regardless of the original type so that's what we receive when it's pasted so that will be a browser issue.
What's weird though is this didn't happen to me in 2.2. Do you see this in 2.2 as well?
 
The issue occurs at the time the image is copied, so it would affect pasting on any website regardless of software or version.

I tested on both versions and the behavior was the same, then confirmed by inspecting the mime type of the clipboard data.

To be clear, this is distinct from the original issue you reported which has been fixed.
 
I can reproduce that, but the issue is Chrome seems to copy the image as a PNG regardless of the original type so that's what we receive when it's pasted so that will be a browser issue.

Thanks for looking into it.

I've just also tested on Firefox and Edge, and the same is true.

What's weird though is this didn't happen to me in 2.2. Do you see this in 2.2 as well?

I was pretty sure it's a new issue for me, too. Upgraded from 2.2 to 2.3 last week, which triggered members reporting the issue which led me to this thread.

I'm telling our members to use attach files to upload GIFs to preserve animation, but evidently they're all used to just copying and pasting.
 
It's possible there was a recent regression or change in behavior in Chrome which coincided with the timing of your upgrade, but I can reproduce this on any site which allows pasting images so I don't believe it's an XF issue.
 
Using "Attach files" results in the animation being lost here on 2.3. Dragging to the editor (or pasting into) seems to preserve it. Tested with animated webp on macOS only. Haven't done any actual investigating, as it's not really important to us.
 
I am finding with 2.3.3 uploading animated gif is not converting to animated webp. Or even non animated webp.

It stays as animated gif:


diaphragme.gif
 
I am finding with 2.3.3 uploading animated gif is not converting to animated webp. Or even non animated webp.

It stays as animated gif:


View attachment 312607
Can you try to reproduce it this way?

I don't think this bug was completely resolved.

 
Can you try to reproduce it this way?

I don't think this bug was completely resolved.

I uploaded the three gifs and only the first converted to webp, the other two remained as gifs but with webp.gif extension
 
I uploaded the three gifs and only the first converted to webp, the other two remained as gifs but with webp.gif extension
Did all of them animate or did any freeze?

I uploaded them here, on XF, attaching files one by one and the first one animated, but the following 2 froze.
 
All aminating
Odd as the issue only occurred on XF, but not my forum.

I'm thinking they tried to animate and failed, but no matter if you uploaded them again or not, they're cached so it won't resolve the problem. Might've been a 1 time occurrence.
 
Back
Top Bottom