Subject: Re: fvwm2 cannot read xpms created by recent versions of Im

From: "Dmitry Yu. Bolkhovityanov" <[email-masked]>
Date: Thu, 12 Apr 2001 11:34:39 +0700

On 11 Apr 01 at 23:48, [email-masked] wrote:

> Dan Espen <[email-masked]> writes:
>
> > Mike Fabian <[email-masked]> writes:
> > > When converting *.png files to *.xpm with recent versions of convert
> > > from the ImageMagick distribution, the produced *.xpm files
> > > have color names like in the following example fallback.xpm.~1~:
> >
> > Its got to be a problem in the xpm library you are using.
> > Fvwm never parses that stuff itself, it calls xpm library functions
> > to do that.
>
> That seems to be libXpm
>
> mfabian@gregory:~$ ldd /usr/X11R6/bin/fvwm2
>         libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4 (0x40026000)
>         libstroke.so.0 => /usr/lib/libstroke.so.0 (0x40035000)
>         [...]
>
> which comes with XFree86-4.x. I believe that didn't change.

    As far as I remember, XFree86 4.x includes the same XPM library as was
previously distributed as a sepatate package.

    Quoting the "XPM Manual" (xpm-doc-A4.PS.gz), Chapter 2:

        The Colors section contains as many strings as there are colors, and
        each string is as follows:

        <chars> {<key> <color>}+

        . . .

        Colors can be specified by giving the colorname, a # followed by the
        RGB code in hexadecimal, or a % followed by the HSV code (not
        implemented).

    The X color specification (see X(1) for example) states that "color can
be specified either by an abstract color name, or by a numerical color
specification".  And later:

        A  numerical color specification consists of a color space
        name and a set of values in the following syntax:

            <color_space_name>:<value>/.../<value>

        An RGB Device specification is identified  by  the  prefix
        "rgb:" and has the following syntax:

            rgb:<red>/<green>/<blue>

                <red>, <green>, <blue> := h | hh | hhh | hhhh
                h := single hexadecimal digits
                       . . .
       For backward compatibility, an older syntax for RGB Device
       is supported, but its continued  use  is  not  encouraged.
       The  syntax is an initial sharp sign character followed by
       a numeric specification, in one of the following formats:

            #RGB                      (4 bits each)
            #RRGGBB                   (8 bits each)
            #RRRGGGBBB                (12 bits each)
            #RRRRGGGGBBBB             (16 bits each)

    So, the "opacity" (alpha-channel) is image-magick's invention.  Don't
know if it was discussed in their maillists, but it is definitely a very bad
behaviour to produce non-standard .xpm-files.  They could at least introduce
a different <key>, say, "rgba", and write it together with a regular "c"
color.

> But the output of
>
> "ee", "xv", and "display" can display these *.xpm files, but none of
> them links against libXpm, so they are probably parsing the xpm files
> themselves.

    At least "xv" uses its own read/write code for all file formats
including XPM (xvxpm.c).

       ___________________________________________________________________
       Dmitry Yu. Bolkhovityanov  |  Novosibirsk, RUSSIA
       phone (383-2)-39-49-56     |  The Budker Institute of Nuclear Physics
                                  |  Lab. 5-13
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]