I'm using .NET Core 3.1 with C#, and am using SDL2 (including SDL2_image).
I need to find a way to fetch the width and height of an image file before loading it using SDL2_image.IMG_Load(Filename), as this crashes if the dimensions of the image exceed the maximum texture size of the GPU.
All solutions I've seen for this were either for JPEG, or used System.Drawing for .NET Core. Needing to reference a massive library for something as trivial as fetching image width and height seems absurd to me, so I figured I might be able to read them from the file's metadata.
Are there any light-weight, cross-platform solutions (that don't require a big library with many other intended uses) for finding the width/height of an image file?