Roughsketch / imagesize

Quickly probe the size of various image formats without reading the entire file.
MIT License
57 stars 12 forks source link

How much data required to determine image format and dimensions? #5

Closed katyo closed 5 years ago

katyo commented 5 years ago

I tried to use this awesome lib with image data from streams. Because the image data incomplete I need a way to get "not enough data" error or know how much bytes of header required to determine. I think this case quite differs from CorruptedImage or NotSupported.

katyo commented 5 years ago

As I understand when not enough data provided I get IO Error of kind UnexpectedEof. But it isn't so for too short headers because image_type() returns ImageType::Unknown (not error).

Roughsketch commented 5 years ago

Closed since #6 was merged. Thanks.