We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4461 - IMG_Load() refuses to load valid ILBM image files
Summary: IMG_Load() refuses to load valid ILBM image files
Status: RESOLVED FIXED
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: 2.0.4
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-16 20:32 UTC by Holger Schemel
Modified: 2019-06-10 23:31 UTC (History)
0 users

See Also:


Attachments
Minimal test program with ILBM test images to reproduce the bug. (3.57 KB, application/x-gzip)
2019-01-16 20:32 UTC, Holger Schemel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Schemel 2019-01-16 20:32:44 UTC
Created attachment 3577 [details]
Minimal test program with ILBM test images to reproduce the bug.

Summary: IMG_Load() only loads ILBM image files with 1, 4, 8 or 24 bit planes.

How to reproduce the problem: Trying to load a valid ILBM image file with 2, 3, 5 or 6 bit planes fails with error message "unsupported number of color planes".

Expected behaviour: IMG_Load() loads all valid ILBM image files with various number of bitplanes.

Observed behaviour: IMG_Load() only loads a small subset of valid ILBM files.

SDL2_image 2.0.3 and 2.0.4 cannot load ILBM images with a "usual" (and totally valid) number of bitplanes as used on the Amiga anymore, that is, ILBM files with up to 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 (apparently arbitrarily) limits loading ILBM files to those with either 1, 4, 8 or 24 bitplanes, which prevents typical ILBM files from the Amiga from being loaded.

The attached minimal test program and test ILBM files (newly created on an Amiga with Deluxe Paint IV today) shows the problem. Just extract and type "make". (The test program only loads the ILBM files, but does not display them.)

This bug can easily be fixed by simply reverting the above commit.
Comment 1 Holger Schemel 2019-01-16 20:45:51 UTC
Maybe it should be noted that loading (and displaying) all these ILBM test files works just fine with previous versions of SDL_image (up to version 2.0.2).
Comment 2 Sam Lantinga 2019-06-10 23:31:19 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL_image/rev/b9f71b5a12ba