[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mgp-users-jp 00809] transparent images



こんにちは、

Geraldoと申します。mgp-snap-20010312.tar.gz からコンパイルしたmgpを
使っているのですが、images の使用について問題があります。imlib_loader 
を使ったら、いくら不透 image でも、皆の #FFFFFF color の pixel は
透過になります。imlib_loader を使わないと、正しくなります。

ソースコードを調べて見ました。image/imlib_loader.c:41 にはバグがあると
思います。Patch を付けました。

[]s Geraldo Brito

PS: Sorry for my poor Japanese.

--- imlib_loader.c	Thu Jan 18 07:07:14 2001
+++ ../../my-kit/image/imlib_loader.c	Mon Mar 19 11:41:55 2001
@@ -38,11 +38,11 @@
 	memcpy(image->data, im->rgb_data, size);
 	
 	Imlib_get_image_shape(id, im, &shape);
-	image->trans = \
-		((shape.r & 0xff) << 16) |
-		((shape.g & 0xff) <<  8) |
-		((shape.b & 0xff) <<  0);
-
+	if ((shape->r >=0) && (shape->g >= 0) && (shape->b >= 0))
+	  image->trans = \
+	    ((shape.r & 0xff) << 16) |
+	    ((shape.g & 0xff) <<  8) |
+	    ((shape.b & 0xff) <<  0);
 	image->title = dupString(name);
 	
 	return image;