OpenCV: how to get image format if reading from buffer?
There is a standard Python functionimghdr.what. It rulez!
^__^
I read an image (of unknown format, most frequent are PNGs or JPGs) from a buffer.
I can decode it with cv2.imdecode, I can even check if it is valid (imdecode returns non-None).
But how can I reveal the image type (PNG, JPG, something else) of the buffer I've just read?