Commit ac6739cd authored by Manish Singh's avatar Manish Singh

Plugins now get DISPLAY properly set in the env

pcx save fix from Nicholas Lamb
put aclocal.m4 into .cvsignore

-Yosh
parent 41fb8c19
......@@ -8,3 +8,4 @@ stamp-h
gimprc
config.status
libtool
aclocal.m4
Wed Dec 17 15:33:23 PST 1997 Manish Singh <yosh@gimp.org>
* 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 <scott@poverty.bloomington.in.us>
* plug-ins/xpm/xpm.c (run): Added access to the alpha cutoff via
......
......@@ -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;
......
......@@ -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 <stdio.h>
......@@ -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) {
......
......@@ -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 <stdio.h>
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment