diff --git a/ChangeLog b/ChangeLog index ff79fbebc5..ae838566ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-04-02 Nick Lamb + * plug-ins/common/png.c + Brown paper bag version, 1.2.1 -- that'll teach me to hurry + the testing process. This should fix it all image types. + 2000-04-02 Garry R. Osgood * gimp/app/colormap_dialog.i.c @@ -22,7 +27,6 @@ I reverted the png change since, while it worked fine for RGBA and INDEXEDA it totally shred RGB and INDEXED images to pieces.. :( ->>>>>>> 1.2502 Sun Apr 2 16:55:47 BST 2000 * app/bezier_select.c diff --git a/plug-ins/common/png.c b/plug-ins/common/png.c index 0c82f206ca..356e10db20 100644 --- a/plug-ins/common/png.c +++ b/plug-ins/common/png.c @@ -59,7 +59,7 @@ * Constants... */ -#define PLUG_IN_VERSION "1.2 - 2 April 2000" +#define PLUG_IN_VERSION "1.2.1 - 2 April 2000" #define SCALE_WIDTH 125 #define DEFAULT_GAMMA 2.20 @@ -858,7 +858,7 @@ save_image (gchar *filename, /* I - File to save to */ }; - if (info->valid | PNG_INFO_tRNS) { + if (info->valid & PNG_INFO_tRNS) { /* It's not really a VERY evil hack, right? -- ruth */ png_set_tRNS(pp, info, (png_bytep) "\0", 1, NULL); } @@ -901,13 +901,21 @@ save_image (gchar *filename, /* I - File to save to */ num = end - begin; gimp_pixel_rgn_get_rect (&pixel_rgn, pixel, 0, begin, drawable->width, num); - if (info->valid | PNG_INFO_tRNS) { + if (info->valid & PNG_INFO_tRNS) { for (i = 0; i < num; ++i) { fixed= pixels[i]; for (k = 0; k < drawable->width; ++k) { fixed[k] = (fixed[k*2+1] > 127) ? fixed[k*2] + 1 : 0; } } + /* Forgot this case before, what if there are too many colors? */ + } else if (info->valid & PNG_INFO_PLTE && bpp == 2) { + for (i = 0; i < num; ++i) { + fixed= pixels[i]; + for (k = 0; k < drawable->width; ++k) { + fixed[k] = fixed[k*2]; + } + } } png_write_rows (pp, pixels, num);