runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Png is an unknown media type in MediaTypeNames

Open MichielDG opened this issue 6 years ago • 3 comments

In the class System.Net.Mime.MediaTypeNames.Image png does not exist.

Motivation

Png is a standaard image type that is widely used.

Existing class: https://github.com/dotnet/runtime/blob/master/src/libraries/System.Net.Mail/ref/System.Net.Mail.cs#L314-L339

Proposed Solution

public static partial class MediaTypeNames
{
    ...
    public static partial class Image
    {
        public const string Gif = "image/gif";
        public const string Jpeg = "image/jpeg";
        public const string Tiff = "image/tiff";
        public const string Png = "image/png";
    }
    ...
}

MichielDG avatar Apr 09 '20 11:04 MichielDG

Tagging @dotnet/ncl as an area owner

ghost avatar Apr 09 '20 11:04 ghost

Duplicate of #1489

scalablecory avatar Apr 09 '20 15:04 scalablecory

Thanks for your suggestion @MichielDG -- mainly we want to prevent adding ad-hoc enum names based on anecdotal data (i.e. somebody finds it useful, or some specification uses it somewhere). We would like to have some usage-driven approach to add the most interesting/important ones - see https://github.com/dotnet/runtime/issues/1489#issuecomment-537625716

If you are passionate about image type names, I'd be personally ok if we do the main issue in stages and one/first of them is focused on image mime types. Doing a brief research how much are these magical strings used e.g. on GitHub, or referenced on StackOverflow would be IMO great way to provide backing usage data for each. That will help to push this forward.

karelz avatar Apr 09 '20 17:04 karelz