deltachat / deltachat-desktop

Email-based instant messaging for Desktop.
GNU General Public License v3.0
914 stars 166 forks source link

Animated GIFs no longer play when sent #3570

Closed binarydad closed 9 months ago

binarydad commented 10 months ago

Previously, I was able to copy/paste an animated GIF and not only did it play in the text box, but also (of course) in the chat history. It also worked for attaching a GIF image. Now, while the animation plays when pasting the image or attaching an image, when sent, just a static image is sent. I can get it to work when I attach as a "File" instead of an "Image".

I imagine this is due to the new image compression happening in this new version? Can GIF images be ignored when compressing before being sent?

Simon-Laux commented 10 months ago

Find an animated GIF (say, giphy.com), copy and paste into the chat text box (note that it plays once pasted)

how do you copy it from giphy? when I try to copy it I get the current frame as png, the image seems to be webp and also does not work in other apps like discord for me.

Simon-Laux commented 10 months ago

downloading the webp file and dropping it into deltachat desktop works (still animated), but if I copy from firefox or from chrome I get the image only as png, log output:

 Clipboard available formats: [ 'image/png', 'text/html' ]

maybe it is somewhere inside of the html as base64, I need to check that, but other than that there is not much we can do about it, maybe it's a bug in chrome or in electron? do you know any apps where this works?

Edit: found this, looks like chrome/electron does not support webp in clipboard yet: https://superuser.com/questions/1664216/why-does-google-chrome-and-safari-copy-image-as-png-representation

Edit2:

maybe it is somewhere inside of the html as base64, I need to check that

checked it, the html file only contains a link to the gif file, so it's useless (because we don't want to do network requests from deltachat desktop).

Simon-Laux commented 10 months ago

So impossible to fix I'd say unless we want to write native code that extracts the clipboard contents, but even then IDK if browsers even copy to clipboard correctly or already convert to png while copying?

Note that I tested to get debug info on mainly on MacOS. I added more log statements in https://github.com/deltachat/deltachat-desktop/pull/3574 if someone wants to try on linux and windows, but I don't expect the situation to be better there.

binarydad commented 10 months ago

I'll try and swing back on this tonight but I know this used to work, at least for a short while. I was able to copy GIFs (right-click, copy image) and paste into the chat box. Not only did it play in the chat box, but also in the message history once sent. It was actually really convenient.

This was on Firefox. I have not tried Chrome/Edge.

Even Win + . on Windows 11 didn't work as nicely.

Simon-Laux commented 9 months ago

I suspect the electron upgrade more than the image compression because drag and dropping and attaching the image file (as image) still works perfectly for me. (though webp is not selectable in the image attachment chooser, maybe sth. for a dedicated issue?)

There seem to be some GUI tools to debug clipboard contents: https://github.com/deltachat/deltachat-desktop/issues/2323 DC desktop is based on electron which is based on chrome(sum), might be the chrome does not support pasting of different image types?

farooqkz commented 9 months ago

I just tested with two GIFs:

https://tenor.com/view/catjam-cat-music-jam-vibing-gif-20520051 https://giphy.com/gifs/starwars-oQkEpeve8GcCSh9QcH

I've pasted them in Telegram's saved messages and DC's. The results were the same. The GIF is not animated anymore. So I guess the issue is invalid?

Edit: attaching GIF as an image works

Simon-Laux commented 9 months ago

I think it's also a bug of the browsers, looks like sth we can not really solve, or only partially solve that it only works with some browsers (firefox in this case). I'll close it and put it to project resurrection, as there is no real actionable item for us right now.

Feel free to add more info if you find out sth that could help us solve this then we can bring this issue back to life.