diff --git a/.cvsignore b/.cvsignore index fed7e52f8c..3a5ac574d7 100644 --- a/.cvsignore +++ b/.cvsignore @@ -8,3 +8,4 @@ stamp-h gimprc config.status libtool +aclocal.m4 diff --git a/ChangeLog b/ChangeLog index a52747a454..ade4145a82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Dec 17 15:33:23 PST 1997 Manish Singh + + * plug-ins/pcx/pcx.c: Applied patch to fix PCX saving from + Nicholas Lamb + + * app/main.c: Plugins now get a proper DISPLAY through + gdk_get_display + Wed Dec 17 13:24:48 1997 Scott Goehring * plug-ins/xpm/xpm.c (run): Added access to the alpha cutoff via diff --git a/app/main.c b/app/main.c index c52741af4d..188b14fd9f 100644 --- a/app/main.c +++ b/app/main.c @@ -73,6 +73,7 @@ main (int argc, char **argv) int show_version; int show_help; int i, j; + gchar *display_name, *display_env; atexit (g_mem_profile); @@ -85,6 +86,14 @@ main (int argc, char **argv) GDK_CONTROL_MASK | GDK_MOD1_MASK); + display_name = gdk_get_display (); + display_env = g_new (gchar, strlen (display_name) + 9); + *display_env = 0; + strcat (display_env, "DISPLAY="); + strcat (display_env, display_name); + putenv (display_env); + g_free (display_env); + no_interface = FALSE; no_data = FALSE; use_shm = TRUE; diff --git a/plug-ins/common/pcx.c b/plug-ins/common/pcx.c index 24138c6082..ca72da502e 100644 --- a/plug-ins/common/pcx.c +++ b/plug-ins/common/pcx.c @@ -4,6 +4,8 @@ * This filter's code is based on the GIF loading/saving filter for the GIMP, * by Peter Mattis, and Spencer Kimball. However, code from the "netpbm" package * is no longer used in this plug-in. + * + * Fixes to RLE saving by Nick Lamb (njl195@ecs.soton.ac.uk) */ #include @@ -543,17 +545,12 @@ save_image (char *filename, int Blue[MAXCOLORS]; guchar *cmap; int width, height; - int bpp; + int bpp= 0; int colors; FILE *outfile; guchar *name_buf; - gint max_progress; int i; - /* initialize */ - - bpp = 0; - drawable = gimp_drawable_get(drawable_ID); drawable_type = gimp_drawable_type(drawable_ID); gimp_pixel_rgn_init(&pixel_rgn, drawable, 0, 0, drawable->width, drawable->height, FALSE, FALSE); @@ -563,8 +560,6 @@ save_image (char *filename, gimp_progress_init(name_buf); g_free(name_buf); - max_progress = drawable->height; - switch(drawable_type) { case INDEXED_IMAGE : cmap = gimp_image_get_cmap(image_ID, &colors); @@ -592,6 +587,7 @@ save_image (char *filename, default : fprintf(stderr, "PCX: you should not receive this error for any reason\n"); + return FALSE; break; } @@ -615,6 +611,7 @@ save_image (char *filename, pcx_header.y2 = height - 1; pcx_header.paletteinfo = 1; if(bpp <= 8) { + pcx_header.bytesperline = width; pcx_header.bitsperpixel = 8; pcx_header.nplanes = 1; } @@ -670,21 +667,21 @@ save_8bit(FILE *out, printf("saving %d * %d\n", len, height); while(cur_y < height) { - while(cur_x <= len) { + while(cur_x < len) { temp = (cur_y * len) + cur_x + buffer; v = *temp; times = 1; ++cur_x; temp = (cur_y * len) + cur_x + buffer; - if(cur_x + 63 > len) { + if(cur_x + 62 > len) { max = len; } else - max = cur_x + 63; + max = cur_x + 62; while((*temp == v) && (cur_x < max)) { times ++; - temp = (cur_y * len) + cur_x + buffer; cur_x ++; + temp = (cur_y * len) + cur_x + buffer; } if(times == 1) { if(v >= 0xC0) { diff --git a/plug-ins/pcx/pcx.c b/plug-ins/pcx/pcx.c index 24138c6082..ca72da502e 100644 --- a/plug-ins/pcx/pcx.c +++ b/plug-ins/pcx/pcx.c @@ -4,6 +4,8 @@ * This filter's code is based on the GIF loading/saving filter for the GIMP, * by Peter Mattis, and Spencer Kimball. However, code from the "netpbm" package * is no longer used in this plug-in. + * + * Fixes to RLE saving by Nick Lamb (njl195@ecs.soton.ac.uk) */ #include @@ -543,17 +545,12 @@ save_image (char *filename, int Blue[MAXCOLORS]; guchar *cmap; int width, height; - int bpp; + int bpp= 0; int colors; FILE *outfile; guchar *name_buf; - gint max_progress; int i; - /* initialize */ - - bpp = 0; - drawable = gimp_drawable_get(drawable_ID); drawable_type = gimp_drawable_type(drawable_ID); gimp_pixel_rgn_init(&pixel_rgn, drawable, 0, 0, drawable->width, drawable->height, FALSE, FALSE); @@ -563,8 +560,6 @@ save_image (char *filename, gimp_progress_init(name_buf); g_free(name_buf); - max_progress = drawable->height; - switch(drawable_type) { case INDEXED_IMAGE : cmap = gimp_image_get_cmap(image_ID, &colors); @@ -592,6 +587,7 @@ save_image (char *filename, default : fprintf(stderr, "PCX: you should not receive this error for any reason\n"); + return FALSE; break; } @@ -615,6 +611,7 @@ save_image (char *filename, pcx_header.y2 = height - 1; pcx_header.paletteinfo = 1; if(bpp <= 8) { + pcx_header.bytesperline = width; pcx_header.bitsperpixel = 8; pcx_header.nplanes = 1; } @@ -670,21 +667,21 @@ save_8bit(FILE *out, printf("saving %d * %d\n", len, height); while(cur_y < height) { - while(cur_x <= len) { + while(cur_x < len) { temp = (cur_y * len) + cur_x + buffer; v = *temp; times = 1; ++cur_x; temp = (cur_y * len) + cur_x + buffer; - if(cur_x + 63 > len) { + if(cur_x + 62 > len) { max = len; } else - max = cur_x + 63; + max = cur_x + 62; while((*temp == v) && (cur_x < max)) { times ++; - temp = (cur_y * len) + cur_x + buffer; cur_x ++; + temp = (cur_y * len) + cur_x + buffer; } if(times == 1) { if(v >= 0xC0) {