title: OpenCV: how to get image format if reading from buffer?
body: <p>I read an image (of unknown format, most frequent are PNGs or JPGs) from a buffer.
  I can decode it with <code>cv2.imdecode</code>, I can even check if it is valid (<code>imdecode</code> returns non-None).</p>
  
  <p>But how can I <strong>reveal the image type</strong> (PNG, JPG, something else) of the buffer I've just read?</p>