dc9e7527ce8516efbb098a4f0f8702d49986677b
kate
  Thu Jul 16 09:44:16 2015 -0700
Removing obsolete 8-bit color support. refs #15722

diff --git src/lib/pngwrite.c src/lib/pngwrite.c
index debdd4b..e8b13bb 100644
--- src/lib/pngwrite.c
+++ src/lib/pngwrite.c
@@ -47,53 +47,33 @@
     }
 
 // If setjmp returns nonzero, it means png_error is returning control here.
 // But that should not happen because png_error should call pngAbort which calls errAbort.
 if (setjmp(png_jmpbuf(png)))
     {
     png_destroy_write_struct(&png, &info);
     fclose(png_file);
     errAbort("pngwrite: setjmp nonzero.  "
 	     "why didn't png_error..pngAbort..errAbort stop execution before this errAbort?");
     return FALSE;
     }
 
 // Configure PNG output params:
 png_init_io(png, png_file);
-#ifdef COLOR32
 png_set_IHDR(png, info, mg->width, mg->height, 8, // 8=bit_depth
              PNG_COLOR_TYPE_RGBA, PNG_INTERLACE_NONE,
              PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
-#else
-png_set_IHDR(png, info, mg->width, mg->height, 8, // 8=bit_depth
-             PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE,
-             PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
-png_set_PLTE(png, info,
-             (png_color *)(mg->colorMap), // png_color is same as struct rgbColor!
-             mg->colorsUsed);
-#endif
-#ifndef COLOR32
-if (useTransparency)
-    {
-    // First palette color is assumed to be background/transparent, so
-    // that's the only one we need in the parallel array opacities[].
-    png_byte opacities[] = {0};
-    int num_opacities = ArraySize(opacities);
-    png_color_16p nonPalette_opacities_values = NULL; // n/a for us, we're using palette
-    png_set_tRNS(png, info, opacities, num_opacities, nonPalette_opacities_values);
-    }
-#endif
 
 // Write header/params, write pixels, close and clean up.
 // PNG wants a 2D array of pointers to byte offsets into palette/colorMap.
 // mg has a 1D array of byte offsets.  Make row pointers for PNG:
 
 png_byte **row_pointers = needMem(mg->height * sizeof(png_byte *));
 int i;
 for (i = 0;  i < mg->height;  i++)
     row_pointers[i] = (unsigned char *)&(mg->pixels[i*mg->width]);
 png_set_rows(png, info, row_pointers);
 png_write_png(png, info, PNG_TRANSFORM_IDENTITY, // no transform
 	      NULL); // unused as of PNG 1.2
 png_destroy_write_struct(&png, &info);
 return TRUE;
 }