Determine resolution and image type (without actual decoding) in WP7 / Silverlight

How to determine the resolution (width x height) and type (gif, jpeg, png, bmp, etc.) of an image from a stream (or byte array) without the cost of decoding the entire image?

I know that this can be done simply by reading the headers. Just wondering if any such code or library exists.

+3
source share
2 answers

In addition to the Jpeg information provided in @Leon's backlinks to ..

GIF ASCII "GIF89a", . , Int16 .

PNG 89, ASCII "PNG", 4 . ( 8) 4 ( ).

BMP ASCII "BM". 18 Int32, 22 .

, , 26 , .

+2

, stackoverflow. SemiColon , , , .

HTH Leon

+1

Source: https://habr.com/ru/post/1794879/


All Articles