Problem with xpm images and SDL_Image

I have a problem using XPM image and SDL_Image
library.
It seems that when I create a surface from an XPM, the
function fails if:

  • there are some colors in the XPM dont used in the
    pixed.
  • the colors in the XPM are coded like name (e.g.
    black, white…)

My problem is that i’m using imagemacigk to batch
convert a lot of PNG files to XPM, in order to link
them in to my program.
I havent found anyway to tell the ImageMagik
’convert’ tool to avoid using useless colors and
names.
Can someone help me to solve the problem?

PS I would like to avoid to write a C program to
adjust the XPM produced by ‘convert’.

many tanx___________________________________
Scopri Mister Yahoo! - il fantatorneo sul calcio di Yahoo! Sport
http://it.seriea.fantasysports.yahoo.com/

I have a problem using XPM image and SDL_Image
library.
It seems that when I create a surface from an XPM, the
function fails if:

  • there are some colors in the XPM dont used in the
    pixed.
  • the colors in the XPM are coded like name (e.g.
    black, white…)

My problem is that i’m using imagemacigk to batch
convert a lot of PNG files to XPM, in order to link
them in to my program.
I havent found anyway to tell the ImageMagik
’convert’ tool to avoid using useless colors and
names.
Can someone help me to solve the problem?

Can you post a link to an XPM which isn’t loaded correctly?

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment