Bug 41196

Summary: Xpms generated by convert cannot be read by libXpm
Product: [Retired] Red Hat Linux Reporter: Need Real Name <tomcpierce>
Component: ImageMagickAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-05-18 04:42:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2001-05-18 04:42:55 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2-2 i686)

Description of problem:
ImageMagick 5.2.7 (incl. in RH7.1) seems to have a bug in it's XPM file
generation.  I'm not an expert in the format, but looking at XPMs generated
with RH6.1's version, one difference seems to be that convert is emitting
files with 2 extra (hex) bytes per color, ie:

==> under7.1.xpm <==
/* XPM */
static char *magick[] = {
/* columns rows colors chars-per-pixel */
"54 54 256 2",
"   c #341b3840",
".  c #3c3a0e40",
[...]

vs.

==> under6.1.xpm <==
/* XPM */
static char *magick[] = {
/* columns rows colors chars-per-pixel */
"54 54 256 2",
"   c #341b38",
".  c #3c3a0e",
"X  c #383c18",
"o  c #352f12",
"O  c #37312a",
"+  c #0e3217",
[...]

Use of convert's colordepth flags does not seem to have any effect on the
image file emitted ("-depth 8" or "-depth 16").  

How reproducible:
Always

Steps to Reproduce:
1. Get an image file (I've tried both GIF and JPG)
2. Under RH6.1, run "convert -geom 54x54 <image> under6.1.xpm"
	(optional, but can illustrate the difference..)
3. Under RH7.1, run "convert -geom 54x54 <image> under7.1.xpm"
4. Under RH7.1 try to use xpmroot (a libXpm program) to place your
	xpm image(s) on your X backround ("xpmroot <file>").

XPMs generated by the convert distributed with 7.1 won't be successfully
read.

Actual Results:  % xpmroot under7.1.xpm
Couldn't allocate required colors
[image not displayed on X backround]

The C function XpmReadFileToPixmap(..) returns -2 (XpmFileInvalid, see
xpm.h).



Expected Results:  File displayed on X backround (xpm file generated with
older convert works under RH7.1).

Additional info:

X is running at 15bpp (yes, fifteen..  Riva 128 card).  
This is a clean RH7.1 install, no LD_LIBRARY_PATH settings, etc.

Comment 1 Bernhard Rosenkraenzer 2001-05-20 10:09:25 UTC
Fixed in 5.3.3-2