PNG Brown paper bag version, 1.2.1 -- that'll teach me to hurry

the testing process. This should fix it all image types.
This commit is contained in:
Nick Lamb /GIMP
2000-04-02 22:04:15 +00:00
parent 9591f4a965
commit fcc613c794
2 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2000-04-02 Nick Lamb <njl195@zepler.org.uk>
* 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 <gosgood@idt.net>
* 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

View File

@ -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);