What is the difference between "image/png" and "image/x-png"?

Language AgnosticMime Types

Language Agnostic Problem Overview


What is the difference between "image/png" and "image/x-png"?

Language Agnostic Solutions


Solution 1 - Language Agnostic

The x- prefix is given to non-standard MIME types (i. e. not registered with IANA). So I assume that image/x-png would have been PNG before the MIME type was standardized.

> 6.3. New Content-Transfer-Encodings

> Implementors may, if necessary, define private Content-Transfer-Encoding values, but must use an x-token, which is a name prefixed by “X-”, to indicate its non-standard status, e. g., “Content-Transfer-Encoding: x-my-new-encoding”. Additional standardized Content-Transfer-Encoding values must be specified by a standards-track RFC. > The requirements such specifications must meet are given in RFC 2048. > As such, all content-transfer-encoding namespace except that > beginning with “X-” is explicitly reserved to the IETF for future > use.

> —RFC 2045 — Multipurpose Internet Mail Extensions, Section 6.3

This is also documented in the PNG specification. See FalseVinylShrub's answer.

Solution 2 - Language Agnostic

According to [http://www.w3.org/TR/PNG/#A-Media-type][1]

>The internet media type "image/png" is the Internet Media Type for PNG [RFC-2045], [RFC-2048]. It is recommended that implementations also recognize the media type "image/x-png".

So, if you're delivering or uploading a PNG image, 'image/png' is the correct one to use. However, if you're accepting uploads or otherwise interpreting the media type, you are recommended to accept either.

By the way, I found a reference from 2008 that Internet Explorer (version unspecified) was uploading PNG images with a type of image/x-png, so this was a real issue for someone as recently as that.

[1]: http://www.w3.org/TR/PNG/#A-Media-type "This w3 page"

Solution 3 - Language Agnostic

According to Wikipedia's article on Internet Media Types, and the article it cites...

> Types or subtypes that begin with x- > are nonstandard

So my guess is "image/x-png" is probably leftover from the days when png was pretty new, and as such, not standardized.

Solution 4 - Language Agnostic

image/x-png was the type before PNG was accepted by the IANA as an official mime type.

http://www.iana.org/assignments/media-types/image/

The official image/png MIME type for PNG, approved on 14 October 1996

http://www.w3.org/Graphics/PNG/

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAaron BushView Question on Stackoverflow
Solution 1 - Language AgnosticJoeyView Answer on Stackoverflow
Solution 2 - Language AgnosticFalseVinylShrubView Answer on Stackoverflow
Solution 3 - Language AgnosticRichard JP Le GuenView Answer on Stackoverflow
Solution 4 - Language AgnosticacheoView Answer on Stackoverflow