title: How to detect image format in a stream
body: <p>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)</p>
  
  <p>Is there a way to detect imageformat from a stream?</p>