GNU bug report logs -
#38109
27.0.50; xpm image scaling doesn't work
Previous Next
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
On Fri, Nov 08, 2019 at 10:03:17PM +0100, Adam Sjøgren wrote:
> I apparently haven't got Cairo enabled in my build, maybe that's a
> problem?
No, this should all work without Cairo.
> asjo <at> tullinup:/usr/src/emacs$ grep CAIRO src/config.h
> /* #undef USE_CAIRO */
>
> An observation: when displaying the colormapped .png,
> image_create_x_image_and_pixmap_1() is called twice, the first time
> depth is <= 0, and the second time it isn't.
Does the RGB png call that function twice? The second time through is
for setting the mask, or transparency, and it looks like it sets depth
to ‘1’, which image_create_x_image_and_pixmap_1 doesn’t like with
xrender. Although your patch should have fixed that.
But in addition you might need this:
modified src/image.c
@@ -2244,6 +2244,13 @@ image_set_transform (struct frame *f, struct image *img)
XRenderSetPictureFilter (FRAME_X_DISPLAY (f), img->picture, FilterBest,
0, 0);
XRenderSetPictureTransform (FRAME_X_DISPLAY (f), img->picture, &tmat);
+
+ if (img->mask_picture)
+ {
+ XRenderSetPictureFilter (FRAME_X_DISPLAY (f), img->mask_picture, FilterBest,
+ 0, 0);
+ XRenderSetPictureTransform (FRAME_X_DISPLAY (f), img->mask_picture, &tmat);
+ }
}
# elif defined HAVE_NTGUI
/* Store the transform matrix for application at draw time. */
As I don’t think we were setting the transform for the mask to match
the image. Although I don’t really know for sure if it’s needed.
It really wouldn’t surprise me too much if this was all related to
masks, I never managed to get a satisfactory test going.
OTOH, if XPMs don’t even use these functions then that would certainly
cause scaling to fail. I’ll have to have a look at the XPM code to
find out what they’re doing instead.
--
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.