Instead of attempting to resize a huge image and causing an OOM error, the library should check to see if it's a reasonable size to scale and go from there.
The idea of a "reasonable size" should be determined empirically based on actual memory consumption for resizing an image using the resize technique used in the library.
It's also possible that resizing a huge image is fairly efficient and that this sanity check is unnecessary.