本文翻译自:Is the MIME type 'image/jpg' the same as 'image/jpeg'?
Pretty simple question but can't seem to find it anywhere online. 很简单的问题,但似乎无法在网上找到它。 I'm trying to make a program that depending on the file type will give me the extension. 我正在尝试制作一个程序,该程序根据文件类型为我提供扩展名。
#1楼
参考:https://stackoom.com/question/2hn2P/MIME类型-image-jpg-是否与-image-jpeg-相同
#2楼
No, image/jpg
is not the same as image/jpeg
, only image/jpeg
is recognised as the actual mime type for JPEG files. 不, image/jpg
与image/jpeg
,只有image/jpeg
被识别为JPEG文件的实际mime类型。
See https://tools.ietf.org/html/rfc3745 , https://www.w3.org/Graphics/JPEG/ . 见https://tools.ietf.org/html/rfc3745 , https://www.w3.org/Graphics/JPEG/ 。
Serving the incorrect Content-Type of image/jpg
to IE can cause issues, see http://www.bennadel.com/blog/2609-internet-explorer-aborts-images-with-the-wrong-mime-type.htm . 向IE提供不正确的Content / Type的image/jpg
内容类型可能会导致问题,请参见http://www.bennadel.com/blog/2609-internet-explorer-aborts-images-with-the-wrong-mime-type.htm 。
#3楼
For those it might help, I use this list as a reference to define my content-type when I have to deal with images on my app. 对于那些可能会有所帮助的应用程序,当我必须处理应用程序上的图像时,可以使用此列表作为定义内容类型的参考。
It says that jpg extension can be declared with Content-type : image/jpeg
它说jpg扩展名可以用