Programming and Scripting :: XPM Icon Viewer



Quote (mikshaw @ Nov. 04 2007,01:37)
That icon you linked is seriously messed up. I suppose you tried to modify it in a binary editor even though the copy/paste messed it up to begin with.

..It's working fine on my desktop.
Yes, it works, but it's horribly mangled. It is not what I created.

I'm trying this again with the amps and spaces removed.  It seems to work this time.
Code Sample
/* XPM */
static char * test_xpm[] = {
"32 32 16 1",
"0      c None",
".      c #BBBBA8A89292",
"X      c #ADAD8D8D6969",
"o      c #6B6B51513636",
"O      c #949484847575",
"+      c #6E6E65655B5B",
"@      c #363632322C2C",
"#      c #181818181616",
"$      c #868675756767",
"%      c #53534D4D4747",
"x      c #A3A38F8F7777",
"*      c #CFCFC4C4B7B7",
"=      c #83836B6B4D4D",
"-      c #FEFEFFFFFCFC",
";      c #FCFCDCDC9292",
":      c #C5C5AAAA7171",
"00.XXXXXXXXXXXXXXXXXXXXXXXXXXo00",
"00..XXXXXXXXXXXXXXXXXXXXXXXXoo00",
"00..oooooooooooooooooooooooooo00",
"00..oOOO++@######@@@@@@@++$.oo00",
"00..oO$+@@######@+OOOOO$@@%.oo00",
"00..o+@@#####@%Ox.......O@@.oo00",
"00..o@#####@%$x.....*****O%.oo00",
"00..o#####%$O..........***..oo00",
"00..o@##@%O.....xx=XX=x..**.oo00",
"00..o@#%+Ox.xxO$=%@@@@o=x...oo00",
"00..o@%+Oxxx$+@@@#####@#=Xx.oo00",
"00..o%+OOOO+@@@#########%@X.oo00",
"00..o$OOOO+@@@####O-*#####$.oo00",
"00..oOOxx+@@@#####O*-*#@##+.oo00",
"00..ox.x$@%O%@###*#O*-@O%#@.oo00",
"00..oxO$@%.*+@##*-*###%-.@#.oo00",
"00..oOO@@$*-+@###*####.-*$@.oo00",
"00..oxO%%$*-.%@######%.-*O@.oo00",
"00..o.$@@%.*-.@@@##@@..*.%@.oo00",
"00..o.x%++%.**.%%%%%..*O%##.oo00",
"00..o..xx$%%x.........+@###.oo00",
"0#;;o...;:$+;;;;;++++%@###@.oo00",
"0#;;;..;;:x=;;;;;;;@@@###@%;;;00",
"0##;;;;;;xxo;;XX:;;;%%%;;%$;;;00",
"00#@;;;;o.x@;;###X;;$$;;;O#;;;00",
"00##:;;=...#;;o#o:;;xx;;;;o;;;:0",
"00.%;;;;...#;;;;;;;..=;;;;X;;;;0",
"00.;;:;;;..#;;;;;:@..X;:;;;;;;;0",
"00;;;#o;;..#;;:o##...:;=X;;;o;;:",
"0;;;o##:;;X#;;X##XXX#;;@@;;:#:;;",
"0=;=oo##;;o#;;:ooooo@;;##:;X#=;;",
"00@ooo##@oo#@%oooooo@;;o###o##;;"};

I see what you mean, the letters are clearer.
Looks real good mikshaw.
Adding it to v4.1

Quote
Adding it to v4.1
As I said, though, the script still needs a little work.  In addition to the "true XPM" file parsing, I noticed that I left a couple of debugging print commands in there that I didn't notice until I went back to running it from terminal.

I actually spent a large part of last night searching for a decent gui XPM editor. Most of the graphics apps on my slackware system, including xpaint, gimp, and pixmap, won't save xpm files. I assume they are trying to use a library I don't have (imlib, maybe?). Even the xpaint package made specifically for my slackware version didn't work, and the gui of pixmap is quite buggy. I was able to pipe the image through sxpm from xpaint, but xpaint isn't friendly to xpm files...the trasparency was replaced with black, the color codes are messed up, and there doesn't seem to be any way to load the palette from the xpm file.

Anyway, I finally found mtpaint this morning, which isn't specifically for xpm but works a LOT better than xpaint. The color symbols are all alphanumeric (sweet!), it automatically loads the file's color palette, and actually saves the file in my slackware (directly written from mtpaint, I assume)
http://mtpaint.sourceforge.net/

I'm gonna see if it works as well in DSL.

EDIT: One distinct annoyance with mtpaint is that it apparently won't open XPM files that contain more than 256 colors. I can't imagine what use a high-color XPM would be (unless it's also high resolution, which is equally as odd), but there are a surprisingly large number of them.

Next Page...
original here.