libsdl-org / SDL_image

Image decoding for many popular formats for Simple Directmedia Layer.
zlib License
572 stars 187 forks source link

XPM color names support #317

Open ondratu opened 1 year ago

ondratu commented 1 year ago

Hi,

i'm using ImageMagick to converting my images to XPM files. And ImageMagick uses color names, which can be problem with SDL. I got error colour parse error when i try to load this cube.scad.xpm.gz xpm. Other application works fine, so the problem can be in missing color names definitions.

My versions:

Linux thinkpad 6.0.0-4-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.0.8-1 (2022-11-11) x86_64 GNU/Linux

ii  libsdl2-2.0-0:amd64                      2.24.2+dfsg-1                     amd64        Simple DirectMedia Layer
ii  libsdl2-dev:amd64                        2.24.2+dfsg-1                     amd64        Simple DirectMedia Layer development files
ii  libsdl2-image-2.0-0:amd64                2.6.2+dfsg-2                      amd64        Image loading library for Simple DirectMedia Layer 2, libraries
ii  libsdl2-image-dev:amd64                  2.6.2+dfsg-2                      amd64        Image loading library for Simple DirectMedia Layer 2, development files
ii  libsdl2-mixer-2.0-0:amd64                2.6.2+dfsg-2                      amd64        Mixer library for Simple DirectMedia Layer 2, libraries
ii  libsdl2-ttf-2.0-0:amd64                  2.20.1+dfsg-2                     amd64        TrueType Font library for Simple DirectMedia Layer 2, libraries
ii  libsdl2-ttf-dev:amd64                    2.20.1+dfsg-2                     amd64        TrueType Font library for Simple DirectMedia Layer 2, development files
slouken commented 1 year ago

Yes, we don't build in color name support by default because of the size of the table, but you can define EXTENDED_XPM_COLORS when compiling IMG_xpm.c to get the full list.

ondratu commented 1 year ago

Ok, so that is problem on Debian side, but, is it some way, how to runtime / in compile time detect, if this option is enabled?

stsp commented 1 year ago

I also hit an inability to load an xpm done by ImageMagic's convert.