filemime-types

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.


Solution

  • 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://www.rfc-editor.org/rfc/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.