-
-
Notifications
You must be signed in to change notification settings - Fork 888
Open
Labels
Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of ImageSharp
- I have verified if the problem exist in both
DEBUGandRELEASEmode - I have searched open and closed issues to ensure it has not already been reported
ImageSharp version
3.1.12
Other ImageSharp packages and versions
n/a
Environment (Operating system, version and so on)
Windows 11
.NET Framework version
.NET 8
Description
I would expect UnknownImageFormatException, but you get ArgumentNullException instead. This doesn't seem appropriate because there is no null pointer at the API boundary and because I'd want to catch UnknownImageFormatException specifically to capture all failed detections.
Steps to Reproduce
Image.Identify(new byte[1]); // throws UnknownImageFormatException
Image.Identify(new byte[0]); // throws ArgumentNullException (Value cannot be null. (Parameter 'pointer')
Images
n/a