Your message dated Fri, 5 Jan 2007 21:52:39 +0100
with message-id <[EMAIL PROTECTED]>
and subject line obsoleted by libwraster3
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--- Begin Message ---
Package: libwraster2
Version: 0.65.1-1
Tags: patch
RCombineAreaWithOpaqueness ignores the sx parameter, effectively
treating it as if it were always 0. This is somewhat of a problem if
your source area doesn't begin at the very left edge of the image.
This program illustrates the bug. The original graphic consists of three
squares: red, white, and green in that order. The program attempts to
combine the green (source, at x=10) with the white (destination) at 50%
opacity. However, due to the bug the red square (at x=0) is used
instead.
========== begin test.c ==========
/* gcc -Wall test.c -L/usr/X11R6/lib -lwraster -lXpm -lXext -lX11 */
#include <X11/Xlib.h>
#include <X11/xpm.h>
#include <stdio.h>
#include <wraster.h>
static char * foo_xpm[] = {
"15 5 4 1",
" c None",
". c #FF0000",
"+ c #FFFFFF",
"@ c #00FF00",
".....+++++@@@@@",
".....+++++@@@@@",
".....+++++@@@@@",
".....+++++@@@@@",
".....+++++@@@@@"};
int main(int argc, char **argv){
Display *display;
int screen;
Window Root;
RImage *r;
RContext *rc;
RContextAttributes ra;
Pixmap pix, mask;
if (!(display = XOpenDisplay(NULL))) {
printf("Can't open default display\n");
exit(1);
}
screen = DefaultScreen(display);
Root = RootWindow(display, screen);
/* Not ideal, but... */
XpmCreatePixmapFromData(display, Root, foo_xpm, &pix, &mask, NULL);
rc=RCreateContext(display, screen, &ra);
r=RCreateImageFromDrawable(rc, pix, mask);
printf("Writing /tmp/orig.xpm\n");
RSaveImage(r, "/tmp/orig.xpm", "XPM");
RCombineAreaWithOpaqueness(r, r, 10, 0, 5, 5, 5, 0, 128);
printf("Writing /tmp/new.xpm\n");
RSaveImage(r, "/tmp/new.xpm", "XPM");
XFreePixmap(display, pix);
XFreePixmap(display, mask);
RReleaseImage(r);
XCloseDisplay(display);
return 0;
}
=========== end test.c ===========
This patch seems to fix the problem.
========== begin patch ==========
--- wmaker-0.65.1.orig/wrlib/raster.c Mon May 14 09:13:34 2001
+++ wmaker-0.65.1/wrlib/raster.c Thu Aug 16 16:29:03 2001
@@ -412,7 +412,7 @@
if (!HAS_ALPHA(src)) {
- s = src->data + sy*src->width*3;
+ s = src->data + (sy*src->width + sx)*3;
swi = (src->width - width) * 3;
for (y=0; y < height; y++) {
@@ -428,7 +428,7 @@
} else {
int tmp;
- s = src->data + sy*src->width*4;
+ s = src->data + (sy*src->width + sx)*4;
swi = (src->width - width) * 4;
for (y=0; y < height; y++) {
=========== end patch ===========
--- End Message ---
--- Begin Message ---
libwraster2 has been obsoleted by libwraster3 a long time ago. I'm
closing your bug in the hope that it doesn't apply to libwraster3 but
please correct me if I'm wrong.
--
Martin Michlmayr
http://www.cyrius.com/
--- End Message ---