ILBM loading bug in SDL2_image >= 2.0.3?

I hesitate to directly report this in Bugzilla, because I cannot imagine that nobody else stumbled upon this for about one year, but: It looks like SDL2_image 2.0.3 and 2.0.4 cannot load ILBM images with the “usual” number of bitplanes as used on the Amiga anymore, that is, ILBM files with either 5 bitplanes (32 colors) or 6 bitplanes (64 colors; EHB mode).

The following commit introduced the problem: http://hg.libsdl.org/SDL_image/rev/97f7f01e0665

The commit message says “lbm: Fail to load images with unsupported/bogus color depth”, and the patch limits ILBM files to either 1, 4, 8 or 24 bitplanes, which seems crazy (at least for typical ILBM files from the Amiga).

Can somebody confirm this problem?

I will happily create a nice bug report for this, but I still have the suspicion that I have overseen something by myself… :-o

Holger

Feel free to submit a bug, along with test images and a patch that works for you.

Thanks!

Done: https://bugzilla.libsdl.org/show_bug.cgi?id=4461

Minimal test program and test ILBM image files attached.

Can be patched by simply reverting the above commit.