This is new patch to solve image display problem on some X
server's 24bpp mode. My old patches
(<87r9rt9srg.fsf(a)agrcs.agr.yamaguchi-u.ac.jp>,
<87d83cih4j.fsf(a)agrcs.agr.yamaguchi-u.ac.jp>)
were "dog-slow", please forget it.
1999-02-17 Kazuo Oishi <oishi(a)ae.agr.yamaguchi-u.ac.jp>
* glyphs-x.c (cononvert_EImage_to_XImage): correct byte counting.
--- src/glyphs-x.c.orig Sun Feb 14 22:53:17 1999
+++ src/glyphs-x.c Wed Feb 17 20:30:23 1999
@@ -124,7 +124,7 @@
Colormap cmap;
Visual *vis;
XImage *outimg;
- int depth, bitmap_pad, byte_cnt, i, j;
+ int depth, bitmap_pad, bits_per_pixel, byte_cnt, i, j;
int rd,gr,bl,q;
unsigned char *data, *ip, *dp;
quant_table *qtable = 0;
@@ -149,12 +149,14 @@
bitmap_pad = ((depth > 16) ? 32 :
(depth > 8) ? 16 :
8);
- byte_cnt = bitmap_pad >> 3;
outimg = XCreateImage (dpy, vis,
depth, ZPixmap, 0, 0, width, height,
bitmap_pad, 0);
if (!outimg) return NULL;
+
+ bits_per_pixel = outimg->bits_per_pixel;
+ byte_cnt = bits_per_pixel >> 3;
data = (unsigned char *) xmalloc (outimg->bytes_per_line * height);
if (!data)
--
大石一雄 (OISHI Kazuo)