hey-red / MimeTypesMap

Simple dictionary provides a few methods to lookup mime type/extension, generated From Apache's mime.types.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why no jpg?

spib opened this issue · comments

Hi,

I'm using this in windows and it seems that .jpg isn't supported, only .jpeg. While I'm sure that .jpeg is the 'correct' extension, would it be possible to also support .jpg?

Thanks!

commented

We can add it like this:

MimeTypesMap.AddOrUpdate("image/jpeg", "jpg");

then

MimeTypesMap.GetMimeType("test.jpg") //=> image/jpeg
MimeTypesMap.GetMimeType("test.jpeg") //=> image/jpeg

Thanks for the quick reply, it's great that there is the flexibility to do that but I think most users would expect .jpg to work out of the box?

Is it perhaps worth considering having that included by default?

commented

This is possible, because alternative extensions are present in the apache list, but only the first extension will be added to the dictionary.
I can fix it, but not today(maybe tomorrow).

commented

Fixed 6a88632
Nuget package has been updated.