imageio icon indicating copy to clipboard operation
imageio copied to clipboard

Detect when a file has zero bytes

Open almarklein opened this issue 3 years ago • 1 comments

And raise a sensible exception. Currently, an empty file causes all formats that try to look for a header to fail and this results in an "Could not find a backend to open xx" exception. See #797 for more context.

almarklein avatar Apr 29 '22 14:04 almarklein

I will just add that this would also be nice because it can exit early, removing the need to iterate over all backends just to figure out that none of them can read an empty file.

FirefoxMetzger avatar Apr 29 '22 16:04 FirefoxMetzger