diff --git a/ChangeLog b/ChangeLog index a6b888c312..c3b5e093e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Jan 31 00:16:22 PST 1998 Manish Singh + + * plug-ins/xpm/xpm.c: Changed to use g_strcasecmp + Fri Jan 30 13:47:57 1998 Federico Mena * app/gradient.c: Applied patch from Wolfgang Hofer diff --git a/app/iscissors.c b/app/iscissors.c index 9b43c45a17..1a95eb191a 100644 --- a/app/iscissors.c +++ b/app/iscissors.c @@ -1945,9 +1945,17 @@ construct_edge_map (Tool *tool, srcPR.x=x; srcPR.y=y; srcPR.rowstride = srcPR.bytes * block->width; - srcPR.data = temp_buf_data (block) + offy * srcPR.rowstride + offx * srcPR.bytes; + srcPR.data = temp_buf_data (block) + /*off*/y * srcPR.rowstride + + /*off*/x * srcPR.bytes; destPR.data = temp_buf_data (edge_buf) + - (y - edge_buf->y) * destPR.rowstride + (x - edge_buf->x) * edge_buf->bytes; + y * destPR.rowstride + x * edge_buf->bytes; + + /* look at this debuggin info.*/ + printf("Pixel region dump %d %d\n", x, endx); + printf("rowstride:%d bytes:%d index:%d\n",srcPR.rowstride,srcPR.bytes, index); + printf("x:%d y:%d w:%d h:%d\n",srcPR.x, srcPR.y, srcPR.w, srcPR.h); + printf("sdata:%d ddata:%d\n",srcPR.data, destPR.data); + printf("bdata:%d edata:%d\n", block->data, edge_buf->data); copy_region (&srcPR, &destPR); } diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c index 9b43c45a17..1a95eb191a 100644 --- a/app/tools/gimpiscissorstool.c +++ b/app/tools/gimpiscissorstool.c @@ -1945,9 +1945,17 @@ construct_edge_map (Tool *tool, srcPR.x=x; srcPR.y=y; srcPR.rowstride = srcPR.bytes * block->width; - srcPR.data = temp_buf_data (block) + offy * srcPR.rowstride + offx * srcPR.bytes; + srcPR.data = temp_buf_data (block) + /*off*/y * srcPR.rowstride + + /*off*/x * srcPR.bytes; destPR.data = temp_buf_data (edge_buf) + - (y - edge_buf->y) * destPR.rowstride + (x - edge_buf->x) * edge_buf->bytes; + y * destPR.rowstride + x * edge_buf->bytes; + + /* look at this debuggin info.*/ + printf("Pixel region dump %d %d\n", x, endx); + printf("rowstride:%d bytes:%d index:%d\n",srcPR.rowstride,srcPR.bytes, index); + printf("x:%d y:%d w:%d h:%d\n",srcPR.x, srcPR.y, srcPR.w, srcPR.h); + printf("sdata:%d ddata:%d\n",srcPR.data, destPR.data); + printf("bdata:%d edata:%d\n", block->data, edge_buf->data); copy_region (&srcPR, &destPR); } diff --git a/app/tools/iscissors.c b/app/tools/iscissors.c index 9b43c45a17..1a95eb191a 100644 --- a/app/tools/iscissors.c +++ b/app/tools/iscissors.c @@ -1945,9 +1945,17 @@ construct_edge_map (Tool *tool, srcPR.x=x; srcPR.y=y; srcPR.rowstride = srcPR.bytes * block->width; - srcPR.data = temp_buf_data (block) + offy * srcPR.rowstride + offx * srcPR.bytes; + srcPR.data = temp_buf_data (block) + /*off*/y * srcPR.rowstride + + /*off*/x * srcPR.bytes; destPR.data = temp_buf_data (edge_buf) + - (y - edge_buf->y) * destPR.rowstride + (x - edge_buf->x) * edge_buf->bytes; + y * destPR.rowstride + x * edge_buf->bytes; + + /* look at this debuggin info.*/ + printf("Pixel region dump %d %d\n", x, endx); + printf("rowstride:%d bytes:%d index:%d\n",srcPR.rowstride,srcPR.bytes, index); + printf("x:%d y:%d w:%d h:%d\n",srcPR.x, srcPR.y, srcPR.w, srcPR.h); + printf("sdata:%d ddata:%d\n",srcPR.data, destPR.data); + printf("bdata:%d edata:%d\n", block->data, edge_buf->data); copy_region (&srcPR, &destPR); } diff --git a/plug-ins/common/xpm.c b/plug-ins/common/xpm.c index 5b97172bb4..09883831fd 100644 --- a/plug-ins/common/xpm.c +++ b/plug-ins/common/xpm.c @@ -60,9 +60,6 @@ static void run (char *name, static gint32 load_image (char *filename); -static int -cmp_icase (char *s1, char *s2); - static void parse_colors (XpmImage *xpm_image, guchar **cmap); @@ -312,24 +309,6 @@ load_image (char *filename) -static int -cmp_icase (char *s1, char *s2) -{ - register int c1, c2; - - while (*s1 && *s2) - { - c1 = tolower(*s1++); c2 = tolower(*s2++); - if (c1 != c2) - return (c1 - c2); - } - - return (int) (*s1 - *s2); -} - - - - static void parse_colors (XpmImage *xpm_image, guchar **cmap) { @@ -371,7 +350,7 @@ parse_colors (XpmImage *xpm_image, guchar **cmap) /* parse if it's not transparent. the assumption is that g_new will memset the buffer to zeros */ - if (cmp_icase(colorspec, "None") != 0) { + if (g_strcasecmp(colorspec, "None") != 0) { XParseColor (display, colormap, colorspec, &xcolor); (*cmap)[j++] = xcolor.red >> 8; (*cmap)[j++] = xcolor.green >> 8; diff --git a/plug-ins/xpm/xpm.c b/plug-ins/xpm/xpm.c index 5b97172bb4..09883831fd 100644 --- a/plug-ins/xpm/xpm.c +++ b/plug-ins/xpm/xpm.c @@ -60,9 +60,6 @@ static void run (char *name, static gint32 load_image (char *filename); -static int -cmp_icase (char *s1, char *s2); - static void parse_colors (XpmImage *xpm_image, guchar **cmap); @@ -312,24 +309,6 @@ load_image (char *filename) -static int -cmp_icase (char *s1, char *s2) -{ - register int c1, c2; - - while (*s1 && *s2) - { - c1 = tolower(*s1++); c2 = tolower(*s2++); - if (c1 != c2) - return (c1 - c2); - } - - return (int) (*s1 - *s2); -} - - - - static void parse_colors (XpmImage *xpm_image, guchar **cmap) { @@ -371,7 +350,7 @@ parse_colors (XpmImage *xpm_image, guchar **cmap) /* parse if it's not transparent. the assumption is that g_new will memset the buffer to zeros */ - if (cmp_icase(colorspec, "None") != 0) { + if (g_strcasecmp(colorspec, "None") != 0) { XParseColor (display, colormap, colorspec, &xcolor); (*cmap)[j++] = xcolor.red >> 8; (*cmap)[j++] = xcolor.green >> 8;