GIFs on GitHub pages: Content length exceeded

If you are adding GIFs on your GitHub pages (e.g. README.md), and are getting hit with the "Content length exceeded" message when accessing the said GIFs, it means that your GIFs are too big (more than 5 MB).

Even if the GIFs were initially uploaded to a third site (e.g. blogspot.com, or giphy.com), they are eventually copied to GitHub servers, and if your GIFs are too big (e.g. more than 5 MB), they will no be shown (only the dreaded error message will be seen).

To solve this problem, you have two choices:
  1. Commit your big GIFs to your GitHub repository: you might have other problems eventually when pulling from your repository, since these big GIFs will also be pulled locally
  2. Resize your GIFs: go back to the drawing board, and play with your video editing/GIF making software (e.g. PicGIF Lite) by trimming some images, lowering the video resolution (# pixels wide and tall), or speeding up the video.
The best solution and the one I opted is the second one since I don't want to populate my repository with big GIFs. Starting from a GIF of size 19.9 MB, 20 fps, and running for 15 seconds, I trimmed some images, and sped up the video 4x the normal speed, and I was able to create a short and small GIF (3.73 seconds, 15fps, 3.7 MB):

Figure 1. Short and small GIF running for 3.73 seconds and taking 3.7 MB space

Comments

Popular posts from this blog

Deactivate conda's base environment on startup

Draw arrows with GIMP plugins

Product review: SMONET wireless security camera system