NetBSD Problem Report #60399

From yum@chewiemail.com  Fri Jul  3 00:29:41 2026
Return-Path: <yum@chewiemail.com>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "R13" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C997C1A923A
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  3 Jul 2026 00:29:41 +0000 (UTC)
Message-Id: <20260703002254.C83F6765B0D@lenovo.sleepy.cat>
Date: Thu, 02 Jul 2026 18:22:54 -0600 (MDT)
From: jgw@sdf.org
Reply-To: jgw@sdf.org
To: gnats-bugs@NetBSD.org
Subject: /usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm has bad colormap
X-Send-Pr-Version: 3.95
X-From4GNATS: "jgw@sdf.org via gnats" <gnats-admin@NetBSD.org>

>Number:         60399
>Category:       xsrc
>Synopsis:       /usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm has bad colormap
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    xsrc-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 03 00:30:00 +0000 2026
>Last-Modified:  Fri Jul 03 23:45:01 +0000 2026
>Originator:     Jeff W.
>Release:        NetBSD 11.0_RC5
>Organization:
unorganized
>Environment:


System: NetBSD lenovo 11.0_RC5 NetBSD 11.0_RC5 (GENERIC) #0: Tue Jun 30 14:30:15 UTC 2026 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
	display of /usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm fails
        due to a bad colormap, specifically the use of "Grey" instead of
        "Gray" in two places.
>How-To-Repeat:
	install the ImageMagick package and attempt to display with the
        'display <file>' command, then run 'identify <file>' which shows
        --
        identify: unrecognized color `Grey' @ warning/color.c/GetColorCompliance/1064.
        identify: corrupt image `/usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm' @ error/xpm.c/ReadXPMImage/475.
        --

>Fix:
	Because this file only needs a single character replaced in two
        places the bvi binary file editor can be used.  The following
        was done as a proof-of-concept:

        $ sudo pkgin install ImageMagick bvi
        $ cp /usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm /tmp/
        $ bvi /tmp/NetBSD-flag2.xpm
        :set memmove
        :%s/Grey/Gray/g
        :w /tmp/NetBSD-flag2-fixed.xpm
        :q!
        $ identify /tmp/NetBSD-flag2-fixed.xpm
        /tmp/NetBSD-flag2-fixed.xpm XPM 185x150 185x150+0+0 8-bit sRGB 33c 28956B 0.000u 0:00.001
        $ display /tmp/NetBSD-flag2-fixed.xpm
        => image displays as expected

>Audit-Trail:
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: xsrc/60399: /usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm has bad colormap
Date: Fri, 3 Jul 2026 06:05:08 -0000 (UTC)

 gnats-admin@NetBSD.org ("jgw@sdf.org via gnats") writes:

 >	install the ImageMagick package and attempt to display with the
 >        'display <file>' command, then run 'identify <file>' which shows
 >        --
 >        identify: unrecognized color `Grey' @ warning/color.c/GetColorCompliance/1064.
 >        identify: corrupt image `/usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm' @ error/xpm.c/ReadXPMImage/475.


 That's more a bug in ImageMagick.

 XPM format is defined to allow any X11 color name and X11 has always
 allowed both spellings.

 Doesn't mean it is well defined. The list of color names has been
 modified in the past.

 xpmtoppm for example reads a private rgb.txt file that includes a
 color name like AlizarinCrimson, which is not included in our
 (NetBSD base) rgb.txt file but which contains the name crimson (and
 both colors are slightly different).

 The program 'xv' uses libX11 to lookup color names, which obviously
 uses the locally installed X11 rgb.txt (and the local Xcms color
 name database but which only contains red, green and blue).

 ImageMagick contains its own color names, that interestingly enough
 include the name LightGrey and grey. Still LightGrey is not
 recognized for xpm files because:

     { "LightGray", 211, 211, 211, 1, SVGCompliance | X11Compliance | XPMCompliance },
     { "LightGrey", 211, 211, 211, 1, SVGCompliance | X11Compliance },

     { "grey", 190, 190, 190, 1, SVGCompliance | X11Compliance },               
     { "gray", 190, 190, 190, 1, X11Compliance | XPMCompliance },


 The sxpm program (part of the libXpm distribution and in NetBSD)
 uses libX11 like 'xv' but you can pass it an additional rgb.txt
 file to lookup color names from. This adds compatibility to
 multiple environments that use different color names (or different
 values for the same name).


 XPM format also allows explicit color values in multiple color
 name spaces including plain RGB. To avoid issues between
 American, Canadian and UK speakers we could avoid using names
 at all in the NetBSD flag XPM files.

 On the other hand the NetBSD-flag2.xpm contains color names in
 both spellings, so that it will only work in a less atelophobic
 world.

From: Jeff_W<jgw@sdf.org>
To: xsrc-manager@netbsd.org, netbsd-bugs@netbsd.org, gnats-bugs@netbsd.org,
        gnats-admin@netbsd.org
Cc: 
Subject: Re: xsrc/60399: /usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm has
 bad colormap
Date: Fri, 03 Jul 2026 08:04:59 -0600

 "Michael van Elst via gnats" <gnats-admin@NetBSD.org> wrote:

 > The following reply was made to PR xsrc/60399; it has been noted by GNATS.
 >
 > From: mlelstv@serpens.de (Michael van Elst)
 > To: gnats-bugs@netbsd.org
 > Cc: 
 > Subject: Re: xsrc/60399: /usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm has bad colormap
 > Date: Fri, 3 Jul 2026 06:05:08 -0000 (UTC)
 >
 >  gnats-admin@NetBSD.org ("jgw@sdf.org via gnats") writes:
 >  
 >  >	install the ImageMagick package and attempt to display with the
 >  >        'display <file>' command, then run 'identify <file>' which shows
 >  >        --
 >  >        identify: unrecognized color `Grey' @ warning/color.c/GetColorCompliance/1064.
 >  >        identify: corrupt image `/usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm' @ error/xpm.c/ReadXPMImage/475.
 >  
 >  
 >  That's more a bug in ImageMagick.
 >  
 >  XPM format is defined to allow any X11 color name and X11 has always
 >  allowed both spellings.
 >  
 >  Doesn't mean it is well defined. The list of color names has been
 >  modified in the past.
 >  
 >  xpmtoppm for example reads a private rgb.txt file that includes a
 >  color name like AlizarinCrimson, which is not included in our
 >  (NetBSD base) rgb.txt file but which contains the name crimson (and
 >  both colors are slightly different).
 >  
 >  The program 'xv' uses libX11 to lookup color names, which obviously
 >  uses the locally installed X11 rgb.txt (and the local Xcms color
 >  name database but which only contains red, green and blue).
 >  
 >  ImageMagick contains its own color names, that interestingly enough
 >  include the name LightGrey and grey. Still LightGrey is not
 >  recognized for xpm files because:
 >  
 >      { "LightGray", 211, 211, 211, 1, SVGCompliance | X11Compliance | XPMCompliance },
 >      { "LightGrey", 211, 211, 211, 1, SVGCompliance | X11Compliance },
 >  
 >      { "grey", 190, 190, 190, 1, SVGCompliance | X11Compliance },               
 >      { "gray", 190, 190, 190, 1, X11Compliance | XPMCompliance },
 >  
 >  
 >  The sxpm program (part of the libXpm distribution and in NetBSD)
 >  uses libX11 like 'xv' but you can pass it an additional rgb.txt
 >  file to lookup color names from. This adds compatibility to
 >  multiple environments that use different color names (or different
 >  values for the same name).
 >  
 >  
 >  XPM format also allows explicit color values in multiple color
 >  name spaces including plain RGB. To avoid issues between
 >  American, Canadian and UK speakers we could avoid using names
 >  at all in the NetBSD flag XPM files.
 >  
 >  On the other hand the NetBSD-flag2.xpm contains color names in
 >  both spellings, so that it will only work in a less atelophobic
 >  world.
 >  

 Ah well okay, the bug squash team can decide what if anything to
 do here.  I was just surprised ImageMagick had an issue with the
 file as I've used it for years for format conversion as well as
 other things and it seems pretty tolerant.  When I saw it flagged
 NetBSD-flag2.xpm as corrupted I tested NetBSD-flag1.xpm which had
 no similar issue with it's colormap so decided to file a PR.

 Regards,
 jgw

From: RVP <rvp@SDF.ORG>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: xsrc/60399: /usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm has
 bad colormap
Date: Fri, 3 Jul 2026 23:44:21 +0000 (UTC)

 On Fri, 3 Jul 2026, Jeff_W wrote:

 > Ah well okay, the bug squash team can decide what if anything to
 > do here.  I was just surprised ImageMagick had an issue with the
 > file as I've used it for years for format conversion as well as
 > other things and it seems pretty tolerant.  When I saw it flagged
 > NetBSD-flag2.xpm as corrupted I tested NetBSD-flag1.xpm which had
 > no similar issue with it's colormap so decided to file a PR.
 >

 As mlelstv@ said, this is actually an ImageMagick bug. XPM uses X11 colour
 names, so ImageMagick should understand the British spelling ("Grey") too.

 There've been attempts to fix this over the years, but, this is such an
 obscure issue that these've either been a) partially applied[1], or b) lost
 in newer versions[2]:

 -RVP

 [1]: https://jqmagick.imagemagick.org/discourse-server/viewtopic.php?p=98825
 [2]: https://build.opensuse.org/projects/openSUSE/packages/ImageMagick.8951/files/ImageMagick-6.8.5.7-no-XPMCompliance.patch?expand=0

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.