# Very large gifs should be shown as previews

**URL:** https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423
**Category:** Feature
**Created:** [2015年二月19日 20:20 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423 "2015-02-19T20:20:18Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Maestra\_Powers](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maestra_powers/32/37362_2.png) [@Maestra\_Powers](https://meta.discourse.org/u/Maestra_Powers)
#### Post date: [2015年二月19日 20:20 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/1 "2015-02-19T20:20:18Z")

</div>

Guys from my forum likes to post big gifs in “fun pictures” topic. It pisses me off because they weight a lot and page loads forever. I think it’s a good idea to show gifs as a previews and when you click on some picture - ajax it. I’ve seen this feature on [vk.com](http://vk.com) and I rly liked this idea.

P.S. Testy test:

`http://img0.joyreactor.cc/pics/post/%D0%B3%D0%B8%D1%84%D0%BA%D0%B8-superjail-%D0%BC%D1%83%D0%BB%D1%8C%D1%82%D1%81%D0%B5%D1%80%D0%B8%D0%B0%D0%BB-%D0%A1%D0%B2%D0%BE%D1%8F-%D0%B0%D1%82%D0%BC%D0%BE%D1%81%D1%84%D0%B5%D1%80%D0%B0-1886210.gif`

**EDIT**

huge image removed from OP cause 32MB will blow peoples mobile plan.

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [2015年二月19日 20:31 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/2 "2015-02-19T20:31:38Z")

</div>

Related feature request - MP4’s end up being smaller:

> [@Should Discourse convert GIFs to mp4 video files?](https://meta.discourse.org/t/should-discourse-convert-gifs-to-mp4-video-files/16739):
>
> Just read about this neat trick that Twitter is doing with GIFs: Perhaps this is something Discourse would like to mimic in the future. And for the watercooler: If a video format does everything GIF does and more, and with better compression, are the days of the GIF numbered?

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [2015年二月19日 23:53 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/3 "2015-02-19T23:53:45Z")

</div>

In the interim, it might be a good idea to have the lightboxer hide images based on file size as well as dimensions. _Especially_ if they’re animated GIFs.

For some reason, Chrome reacts very, very badly to images like these and becomes almost unusable until the image has finished loading. (This isn’t specific to Discourse, however.)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2015年二月20日 00:04 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/4 "2015-02-20T00:04:03Z")

</div>

Its odd, sometimes this gif totally messes up chrome on windows and sometimes it does nothing, really feels like a chrome bug to me.

My preferred solution here is simple to render a blank div where there are images as soon as an image is not in the browsers view. We already pull posts out and replace with blank divs when you load too much, but this would take it to the next level

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [2015年二月20日 00:28 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/5 "2015-02-20T00:28:48Z")

</div>

I thought at one point animated gifs were click to play above a specific size?

I remember when an capturing animated of a bug for meta I had to make sure it was below a specific size I think it was something like `<460 x <500` to ensure it would play automatically.

Pretty sure @zogstrip has commented on this before.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2015年二月20日 00:41 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/6 "2015-02-20T00:41:40Z")

</div>

It’s above a specific resolution, but not a specific filesize.

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [2015年二月20日 00:47 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/7 "2015-02-20T00:47:56Z")

</div>

Is the size even checked when the file is externally hosted?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2015年二月20日 01:55 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/8 "2015-02-20T01:55:52Z")

</div>

Well yeah, the posting of

# THIRTY

# ONE

# MEGABYTE

gifs should _probably_ be frowned upon. Here’s the video version that imgur created automagically for me at [Imgur: The magic of the Internet](http://imgur.com/uelnPvv)

it’s a 1.93 mb .webm file:

```
General
Format : WebM
Format version : Version 2
File size : 1.94 MiB
Duration : 11s 400ms
Overall bit rate : 1 427 Kbps
Writing application : Lavf55.48.100
Writing library : Lavf55.48.100

Video
ID : 1
Format : VP8
Codec ID : V_VP8
Duration : 11s 400ms
Bit rate : 1 364 Kbps
Width : 640 pixels
Height : 374 pixels
Display aspect ratio : 1.711
Frame rate mode : Constant
Frame rate : 25.000 fps
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.228
Stream size : 1.85 MiB (96%)
Default : Yes
Forced : No

```

Perhaps ask your users to host somewhere that large GIFs are converted to videos..

---

<div class="post-metadata">

### Author: ![Maestra\_Powers](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maestra_powers/32/37362_2.png) [@Maestra\_Powers](https://meta.discourse.org/u/Maestra_Powers)
#### Post date: [2015年二月20日 08:17 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/9 "2015-02-20T08:17:25Z")

</div>

> [@codinghorror](#):
>
> Perhaps ask your users to host somewhere that large GIFs are converted to videos..

This means make users reposting all the time. Sinse there’s no automatic service for this yet that Discourse could use, maybe you guys can add a spoiler shortcode that loads content only when you open it? Then admins could just add a forum rule “post big gifs only in spoilers”. We need spoiler code anyway for topics with movies discrussions.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2015年三月11日 21:47 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/10 "2015-03-11T21:47:26Z")

</div>

It’s interesting that different browsers handle this fine…

Use case is: **31 megabyte animated gif, served from slow host.** Same URL as in first post. Results?

Google Chrome: cripples browser perf during load, intermittently shows animation frames. Performance is at a crawl, to do anything in the browser is painfully slow.

Firefox: browser seems OK during load, shows animation frames at a decent clip as it loads. Performance seems OK, you can do anything while the image is loading.

IE: browser seems OK during load, shows animations at a rapid clip as it loads. Performance seems OK, you can do anything while the image is loading.

So this does seem to be a bit of a Chrome specific problem.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2015年三月11日 22:57 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/11 "2015-03-11T22:57:56Z")

</div>

Looks like this issue is fixed in `Version 43.0.2329.0 canary (64-bit)`

no lag, stuff seems smooth as butter

---

<div class="post-metadata">

### Author: ![Maestra\_Powers](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maestra_powers/32/37362_2.png) [@Maestra\_Powers](https://meta.discourse.org/u/Maestra_Powers)
#### Post date: [2015年三月21日 13:13 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/12 "2015-03-21T13:13:13Z")

</div>

Have you did something with big gifs already? That 31 Mb gif on my forum shows as link now. But other gifs for like a 10 Mb still shows as gifs.

Also, @codinghorror, how do you convert a gif to a video via imgur?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2015年三月21日 16:37 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/13 "2015-03-21T16:37:10Z")

</div>

I reccomend [https://gfycat.com/](https://gfycat.com/)

It’s like a default on many subreddits, since it’s the most used gif service.

---

<div class="post-metadata">

### Author: ![Maestra\_Powers](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maestra_powers/32/37362_2.png) [@Maestra\_Powers](https://meta.discourse.org/u/Maestra_Powers)
#### Post date: [2015年三月21日 19:40 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/14 "2015-03-21T19:40:35Z")

</div>

Well, it doesn’t embeds so I don’t see much profit from this.

[http://gfycat.com/AggressiveClosedEstuarinecrocodile](http://gfycat.com/AggressiveClosedEstuarinecrocodile)

It would be nice to have a checkbox somewhere in admin panel that would make all gifs to show as links. This would solve this problem, not pretty way, but solid way for sure.

---

<div class="post-metadata">

### Author: ![NomNuggetNom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nomnuggetnom/32/122685_2.png) [@NomNuggetNom](https://meta.discourse.org/u/NomNuggetNom)
#### Post date: [2015年三月21日 23:11 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/15 "2015-03-21T23:11:19Z")

</div>

If you right click and hit “Copy video url:”

 ![](https://global.discourse-cdn.com/meta/original/4X/e/9/d/e9d7c87e6d4c1f605b6d9904e3bab02a0518d94c.png)  
And paste that, it embeds it:

[http://fat.gfycat.com/AggressiveClosedEstuarinecrocodile.webm](http://fat.gfycat.com/AggressiveClosedEstuarinecrocodile.webm)

It would be nice if this was done automatically. Maybe the video plays when the poster reaches the post too.

EDIT: In fact, gfycat has an [api to convert GIFs to MP4](http://gfycat.com/api). Might not be such a bad option to have this happen automatically. I bet a plugin could be made for this.

---

<div class="post-metadata">

### Author: ![Maestra\_Powers](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maestra_powers/32/37362_2.png) [@Maestra\_Powers](https://meta.discourse.org/u/Maestra_Powers)
#### Post date: [2015年三月21日 23:34 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/16 "2015-03-21T23:34:04Z")

</div>

Got it. Testing upload to imgur:

[https://i.imgur.com/blHyoCh.webm](https://i.imgur.com/blHyoCh.webm)

* * *

Hmmm… looks exactly the same. And why does it stratched? Discourse did this or some other thing that Discourse uses to embed stuff?

* * *

Fixed it on my forum via CSS.

```
.topic-body video {
    height: auto !important;
    width: auto !important;
}

```

---

<div class="post-metadata">

### Author: ![Maestra\_Powers](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maestra_powers/32/37362_2.png) [@Maestra\_Powers](https://meta.discourse.org/u/Maestra_Powers)
#### Post date: [2015年三月23日 11:19 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/17 "2015-03-23T11:19:57Z")

</div>

Hey, I just realized that gfycat have API and it’s possible to send all gifs from post to their service and change them into video-links automatically.  
[https://gfycat.com/api](https://gfycat.com/api)  
@sam @eviltrout @codinghorror Can you take a look?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2015年三月23日 15:28 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/18 "2015-03-23T15:28:28Z")

</div>

The first line of that document tells me their platform is not ready to be used that way:

> While Gfycat does not yet have a full fledged API with access credentials and advanced access control, the core features are exposed through easy to use JSON endpoints.

It seems risky to use an API that is not stable.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2015年三月23日 20:59 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/19 "2015-03-23T20:59:14Z")

</div>

There is no need to @ mention me on anything really, I read every post on this site.

---

<div class="post-metadata">

### Author: ![lidel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lidel/32/115991_2.png) [@lidel](https://meta.discourse.org/u/lidel)
#### Post date: [2015年三月25日 10:13 UTC](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423/20 "2015-03-25T10:13:27Z")

</div>

> [@Maestra\_Powers](#):
>
> gfycat have API and it’s possible to send all gifs from post to their service and change them into video-links automatically

My thoughts on gfycat from the other thread:

> [@Should Discourse convert GIFs to mp4 video files?](https://meta.discourse.org/t/should-discourse-convert-gifs-to-mp4-video-files/16739/5):
>
> Some communities would benefit from such functionality. Especially ones with download remote images to local setting enabled stuck_out_tongue, but faster page loads alone is a good reason to think about it. Quick hack would be to just use [gfycat.com API](http://gfycat.com/api). Assuming one does not mirror remote images, I think it is achievable even with pure Javascript which you can add via /admin/customize/css\_html. Lets say JS iterates over posts and if it finds .gif image. HTTP GET is performed: [http://upl…](http://upload.gfycat.com/transcode?fetchUrl=i.imgur.com/jGMtJIb.gif)

IMVHO on-the-fly conversion that requires interaction with third party service (gfycat) should be an external plugin or a custom JS.

But I think that default Discourse install could easily ship with automatic onebox for _already existing_ Gfycat links, just like it [already does for GIFV from Imgur](https://meta.discourse.org/t/mp4-gif-embedding/24935).

So this:

```
http://gfycat.com/AggressiveClosedEstuarinecrocodile

```

could be easily oneboxed into a looped `<video>` tag with mp4/webm sources:

```html
<video autoplay="autoplay" muted="muted" preload="auto" loop="loop" poster="//thumbs.gfycat.com/AggressiveClosedEstuarinecrocodile-poster.jpg">
    <source src="//fat.gfycat.com/AggressiveClosedEstuarinecrocodile.webm" type="video/webm">
    <source src="//fat.gfycat.com/AggressiveClosedEstuarinecrocodile.mp4" type="video/mp4">
</video>

```

[下一頁](https://meta.discourse.org/t/very-large-gifs-should-be-shown-as-previews/25423.md?page=2)
