Search code examples
imagegithubpreview

Github image's links downloaded instead of showing


I have a group of .gif images in a Github repository, they all look perfect in a browser except two: they download instead.

These are right:

https://raw.githubusercontent.com/akidaniel/almacen/gh-pages/paillettes_html/images/3SKULLS.gif https://raw.githubusercontent.com/akidaniel/almacen/gh-pages/paillettes_html/images/HEART.gif

These are not:

https://raw.githubusercontent.com/akidaniel/almacen/gh-pages/paillettes_html/images/POCKET.gif https://raw.githubusercontent.com/akidaniel/almacen/gh-pages/paillettes_html/images/DISCO.gif

I don't see any difference in the links except the gif name


Solution

  • As seen in pypa/warehouse issue 5596

    The issue is that the Content-Type for this image is application/octet-stream.
    Instead, it should be image/gif.

    I've submitted a ticket to GitHub for why the Content-Type of my gif image is mistaken to application/octet-stream.

    GitHub replied:

    It seems we serve gif files under 5MB via raw.githubusercontent.
    Any files over this size are served as downloadable octet-stream files.

    It seems that there is nothing I can do but shrinking the gif image.

    Check if, in your case, this is not a size issue in akidaniel/almacen/tree/gh-pages/paillettes_html/images.