GNU bug report logs - #38109
27.0.50; xpm image scaling doesn't work

Previous Next

Package: emacs;

Reported by: Adam Sjøgren <asjo <at> koldfront.dk>

Date: Thu, 7 Nov 2019 21:12:02 UTC

Severity: normal

Found in version 27.0.50

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Third <alan <at> idiocy.org>
To: Adam Sjøgren <asjo <at> koldfront.dk>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 38109 <at> debbugs.gnu.org
Subject: bug#38109: Updated Emacs to HEAD, consistently not scaling now
Date: Fri, 8 Nov 2019 19:34:07 +0000
On Thu, Nov 07, 2019 at 11:12:31PM +0100, Adam Sjøgren via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote:
> Lars writes:
> 
> > I made two PNGs from wry.xpm. 
> >
> > file /tmp/wry*.png 
> > /tmp/wry2.png: PNG image data, 13 x 14, 8-bit/color RGBA, non-interlaced
> > /tmp/wry.png:  PNG image data, 13 x 14, 2-bit colormap, non-interlaced
> >
> > With the colormap png, I see the same as you -- no scaling, but a large
> > canvas.  With the non-colormap one, I get the proper scaling, too.
> 
> Interesting; the files I tested with:
> 
>   $ file wry.*
>   wry.gif: GIF image data, version 89a, 16 x 16
>   wry.png: PNG image data, 16 x 16, 4-bit colormap, non-interlaced
> 
> So that's consistent with what you see. Perhaps testing was done with
> RGB(A) images, and not with colormaps/palettes.

OK, that makes sense. Check out the comment and code at line 2593 of
image.c:

    /* FIXME: Do we need to handle all possible bit depths?
       XRenderFindStandardFormat supports PictStandardARGB32,
       PictStandardRGB24, PictStandardA8, PictStandardA4,
       PictStandardA1, and PictStandardNUM (what is this?!).
    
       XRenderFindFormat may support more, but I don't
       understand the documentation.  */
    format = XRenderFindStandardFormat (display,
                                        depth == 32 ? PictStandardARGB32
                                        : depth == 24 ? PictStandardRGB24
                                        : PictStandardA8);
    *picture = XRenderCreatePicture (display, *pixmap, format, 0, &attr);

There should be an error message somewhere telling you that Emacs
doesn’t support scaling with that bit depth.

I guess it should be simple enough to add 4 and 1 bit to the above
which I hope would cover some of the above cases...
-- 
Alan Third




This bug report was last modified 5 years and 176 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.