File with JPG extension acts like a GIF with a cat shooting a gun with heavy kickback [closed]

ⅰ亾dé卋堺 提交于 2019-12-03 07:01:24

问题


I recently came across this image which seems like a normal GIF:

Even imgur stores it as a GIF when I uploaded it here.

But when I saw the link, it was a JPEG image, unlike a GIF than what I had expected!

Here's the link: https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash3/559307_325955130827518_630404691_n.jpg


回答1:


This is actually a .gif - look at the headers of the HTTP response.

The MIME type is image/gif

So it doesn't matter what the URL says at the end - it's the MIME type that determines how your browser interprets it.

A lot of sites use this (I guess to throw off harvesters?) imgur.com often reports the wrong extension, for example. Try going to i.imgur.com/yourpic.txt - it should still show up as a proper gif.



来源:https://stackoverflow.com/questions/11529941/file-with-jpg-extension-acts-like-a-gif-with-a-cat-shooting-a-gun-with-heavy-kic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!