When I use my reaction gifs, they stay still, defeating the purpose of my dank memes collection! :grin:


Hello Private Gump,
unluckily this is due to the fact that the server does not offer gif previews. And we use previews to prevent size troubles.
So I would either move this to the server, or someone tells me how we can savely detect the size and use the original file then instead.
yours
Lieutenant Dan
Having gif preiew would also be nice for Android, as this is also requested there.
In the viewer if a file is a gif, we just don't use the preview but fetch the dav url directly. :)
Though, can't you access a file size from the shared file? I have no idea how the share backend works on chat rooms :thinking:
Let's involve the preview expert @rullzer
In the viewer if a file is a gif, we just don't use the preview but fetch the dav url directly. :)
Gif files can be quite large, having this fetched (at least on mobile) is something I do not want (e.g. Talk on mobile or files app).
For desktop/web ui this might be an option…
So for me it is still not clear what a gif preview would do. Because we can't just take every 100th frame. etc.
That is why it right now is just the still image.
Fetching the whole file is the only way I really see for animated gifs...
@tobiasKaminsky @rullzer imgur started converting gifs to video if they were over 1.5MB (or something). This allowed them to serve lots of data without disturbing the user experience :)
We could have a preview provider for that?
Could also have the preview with a play icon on top and if you click it we play the full thing?
Could also have the preview with a play icon on top and if you click it we play the full thing?
Could be nice, if a file is over xxxMB, I feel like we should not completely rule out autoplay :grin:
While encoding them to mp4 is probably gonna save a LOT of space (gifs are insanely inefficient) we don't preview videos either... a play button is probably best, and maybe (later?) auto-play when scrolling into view and pausing the scroll (like 'others' do, like twitter).
Fetching the whole file is the only way I really see for animated gifs...
Couldn't you just do that, and then have a cron job that "cleans up" old gifs in talk by replacing them with just a still after, like, a month or something?
EDIT: By the way I guess I'm just commenting to bitch about features that are missing, but you guys are unbelievable rockstars. The amount of value you guys have made for people with Nextcloud is next-!@#$ing-level - mad props all around, I want to buy y'all _AT LEAST_ some beers.
As far as I can see if you enable the preview provider \OC\Preview\Movie, you can see a preview picture in the chat for a video. You still need to click it to get a lightbox with a player that automatically starts. For regular videos like mp4 I think this is enough interaction. However we could add a play button on top to make it clearer that it's a video and not a picture (could raise another ticket if we agree).
The "Movie" provider uses ffmpeg/avconv in the back to extract a picture at either 5s, 1s, or 0s (whichever worked first).
For the short term (quickfix), I propose to do the following in the Talk app:
Edit: added cropping
Also, improve the inline flow of gifs a bit, no cropping, looks more like an inline message than an attachement? :)
For detecting the file size:
OC.Files.getClient().getFileInfo('/Talk/VID_20200929_085746.mp4', {properties:["{DAV:}getcontentlength"]}).then((status, info) => console.log(info.size)) worked for me
Or do a HEAD call on the read file and read the Content-Length property.
Also, improve the inline flow of gifs a bit, no cropping, looks more like an inline message than an attachement? :)
This seems to be a general issue, also with other pictures.
As far as I can see the pictures are always in individual messages even when uploaded in bulk, so we should allow more horizontal expansion. Need to find back why the decision for square cropping was made to see if it's still valid.
OC.Files.getClient().getFileInfo('/Talk/VID_20200929_085746.mp4', {properties:["{DAV:}getcontentlength"]}).then((status, info) => console.log(info.size))worked for me
You should already have this in the message I think.
Additional requests doesn't seems to be efficient.
Also, please do not rely on OC.Files.getClient as this will be nuked as soon as we can :)
You should already have this in the message I think.
Apparently not, but you have data already, would need a slight api change I guess

I've implemented the cropping/ratio fix separately, see https://github.com/nextcloud/spreed/pull/4469
indeed, reddit converts to mp4, look at that url... https://external-preview.redd.it/yDHSdJSPeLvke9OlYUCRVjA0a8U6gBjWd3DfpG_SWZQ.gif?format=mp4&s=57a4a0877d90467317d2f3bcad158b98fec98410
PR here that brings rendering of GIFs: https://github.com/nextcloud/spreed/issues/4471
For the server bit, I found this ticket about transcoding videos to another format in order to be able to play them in the browser: https://github.com/nextcloud/server/issues/21633
The animated GIF thing would simply be an additional format that could be converted to a browser-compatible video format for playback.
Most helpful comment
Hello Private Gump,
unluckily this is due to the fact that the server does not offer gif previews. And we use previews to prevent size troubles.
So I would either move this to the server, or someone tells me how we can savely detect the size and use the original file then instead.
yours
Lieutenant Dan