Is the MIME type 'image/jpg' the same as 'image/jpeg'?

Joe Scotto picture Joe Scotto · Nov 13, 2015 · Viewed 269.3k times · Source

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.

Answer

Adrian Baker picture Adrian Baker · May 17, 2016

No, image/jpg is not the same as image/jpeg.

You should use image/jpeg. Only image/jpeg is recognised as the actual mime type for JPEG files.

See 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.