I use Image.FromFile() to read image files uploaded by a user. For the 'choose file' dialog box, what file extensions can I allow?
Thanks!
Formats like WebP and AVIF are recommended as they perform much better than PNG, JPEG, GIF for both still and animated images. WebP is widely supported while AVIF lacks support in Safari. SVG remains the recommended format for images that must be drawn accurately at different sizes.
There are four main image file types that are most widely used online: JPG, PNG, GIF and SVG. This article will look at what each of the different file types are designed for and tell you when you should use them.
There are three file formats for graphics used on the web: JPG, GIF, and PNG. Each of these file formats are designed with a specific purpose in mind, so it is important to understand the differences when we use them in our websites.
From microsoft's documentation: http://msdn.microsoft.com/en-us/library/stf701f5.aspx
I believe this should be the filter string:
Bitmap images|*.bmp|GIF images|*.gif|JPEG images|*.jpg; *.jpeg; *.jpe; *.jif; *.jfif; *.jfi|PNG images|*.png|TIFF images|*.tiff; *.tif|All files|*.*
Note that I allowed for additional valid extensions for JPEG and TIFF images.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With