2

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?

Claus Thomsen
  • 2,325
  • 2
  • 24
  • 27

1 Answers1

8

Use Image.FromStream to load the image, then you can see what the Image.RawFormat is.

configurator
  • 40,828
  • 14
  • 81
  • 115