Unable to embed a gif on imgur to a README.md on github

Zen picture Zen · Jun 10, 2016 · Viewed 13.3k times · Source

I want to show a large gif on README.md. Firstly, I uploaded it to imgur. And then, I added the url to README.md # <img alt="YAP" src="http://i.imgur.com/dNYswmI.gif">. But it cannot be loaded, it was compiled to:

<a href="https://camo.githubusercontent.com/b4f1167e599ce7936bb83aad5d007ca8f04345ac/687474703a2f2f692e696d6775722e636f6d2f644e5973776d492e676966" target="_blank">
    <img alt="YAP" src="https://camo.githubusercontent.com/b4f1167e599ce7936bb83aad5d007ca8f04345ac/687474703a2f2f692e696d6775722e636f6d2f644e5973776d492e676966" data-canonical-src="http://i.imgur.com/dNYswmI.gif" style="max-width:100%;"></a>

This is my README.

###Description
  A open source player.

###Screenshot
# <img alt="YAP" src="http://i.imgur.com/dNYswmI.gif">

Answer

williamli picture williamli · Oct 12, 2017

The gif you shared is 19MB in size.

GitHub routes all content through https://camo.githubusercontent.com/ even for external source now. Sharing a file that is bigger than the size limit (10MB) will get you a "Content length exceeded" error.

I tried sharing it on Google Drive, Dropbox, Droplr, my own server all ran into this issue unless the file size is below 10MB. It also doesn't matter if your syntax is in html or markdown.

<img src="https://static01.bbi.io/2Wt9Tk.gif"/>

!(image)[https://static01.bbi.io/2Wt9Tk.gif]

Your solution is to resize your gif. You can do it with service like this one: https://ezgif.com/resize .