I need to detect Image format to save a image like image1.jpg, image2.gif, but i only have a stream, and i do not know the image format(gif, jpeg, png, etc)
Is there a way to detect imageformat from a stream?
I need to detect Image format to save a image like image1.jpg, image2.gif, but i only have a stream, and i do not know the image format(gif, jpeg, png, etc)
Is there a way to detect imageformat from a stream?
Use Image.FromStream
to load the image, then you can see what the Image.RawFormat
is.