---- netpbm-10.47.63/converter/other/pnmtopng.c.orig 2016-09-26 18:44:20.000000000 +0200
-+++ netpbm-10.47.63/converter/other/pnmtopng.c 2016-10-26 20:21:09.553805369 +0200
+--- netpbm-10.47.73/converter/other/pnmtopng.c.orig 2019-06-28 23:02:17.000000000 +0200
++++ netpbm-10.47.73/converter/other/pnmtopng.c 2019-07-27 10:44:23.878530313 +0200
@@ -59,7 +59,8 @@
#include <assert.h>
#include <string.h> /* strcat() */
struct zlibCompression {
/* These are parameters that describe a form of zlib compression.
-@@ -2123,6 +2110,7 @@ makePngLine(png_byte * const l
+@@ -2131,6 +2118,7 @@ makePngLine(png_byte * const l
gray * const alpha_mask,
colorhash_table const cht,
coloralphahash_table const caht,
png_info * const info_ptr,
xelval const png_maxval,
unsigned int const depth) {
-@@ -2134,21 +2122,22 @@ makePngLine(png_byte * const l
+@@ -2142,21 +2130,22 @@ makePngLine(png_byte * const l
for (col = 0; col < cols; ++col) {
xel p_png;
xel const p = xelrow[col];
if (depth == 16)
*pp++ = PPM_GETR(p_png) >> 8;
*pp++ = PPM_GETR(p_png) & 0xff;
-@@ -2161,7 +2150,7 @@ makePngLine(png_byte * const l
+@@ -2169,7 +2158,7 @@ makePngLine(png_byte * const l
} else
pm_error("INTERNAL ERROR: undefined color_type");
int const png_alphaval = (int)
alpha_mask[col] * (float) png_maxval / maxval + 0.5;
if (depth == 16)
-@@ -2218,7 +2207,7 @@ writeRaster(png_struct * const p
+@@ -2226,7 +2215,7 @@ writeRaster(png_struct * const p
makePngLine(line, xelrow, cols, maxval,
alpha, alpha ? alpha_mask[row] : NULL,
png_write_row(png_ptr, line);
}
-@@ -2230,12 +2219,12 @@ writeRaster(png_struct * const p
+@@ -2238,12 +2227,12 @@ writeRaster(png_struct * const p
static void
doGamaChunk(struct cmdlineInfo const cmdline,
}
}
-@@ -2243,20 +2232,16 @@ doGamaChunk(struct cmdlineInfo const cmd
+@@ -2251,20 +2240,16 @@ doGamaChunk(struct cmdlineInfo const cmd
static void
doChrmChunk(struct cmdlineInfo const cmdline,
}
}
-@@ -2264,15 +2249,13 @@ doChrmChunk(struct cmdlineInfo const cmd
+@@ -2272,15 +2257,13 @@ doChrmChunk(struct cmdlineInfo const cmd
static void
doPhysChunk(struct cmdlineInfo const cmdline,
}
}
-@@ -2281,26 +2264,29 @@ doPhysChunk(struct cmdlineInfo const cmd
+@@ -2289,26 +2272,29 @@ doPhysChunk(struct cmdlineInfo const cmd
static void
doTimeChunk(struct cmdlineInfo const cmdline,
(pngMaxval > maxval || (alpha && pngMaxval > alphaMaxval))) {
/* We're writing in a bit depth that doesn't match the maxval
-@@ -2319,27 +2305,27 @@ doSbitChunk(png_info * const pngInfoP,
+@@ -2327,27 +2313,27 @@ doSbitChunk(png_info * const pngInfoP,
sBIT chunk.
*/
}
}
-@@ -2620,43 +2606,40 @@ convertpnm(struct cmdlineInfo const cmdl
+@@ -2628,43 +2614,40 @@ convertpnm(struct cmdlineInfo const cmdl
pm_error ("setjmp returns error condition (2)");
}
}
/* creating hIST chunk */
if (cmdline.hist) {
-@@ -2682,18 +2665,17 @@ convertpnm(struct cmdlineInfo const cmdl
+@@ -2690,18 +2673,17 @@ convertpnm(struct cmdlineInfo const cmdl
ppm_freecolorhash(cht);
}
} else {
/* This is PNG_COLOR_MASK_ALPHA. Transparency will be handled
-@@ -2701,13 +2683,17 @@ convertpnm(struct cmdlineInfo const cmdl
+@@ -2709,13 +2691,17 @@ convertpnm(struct cmdlineInfo const cmdl
*/
}
if (verbose) {
else
pm_message("No transparent color");
}
-@@ -2715,46 +2701,40 @@ convertpnm(struct cmdlineInfo const cmdl
+@@ -2723,29 +2709,29 @@ convertpnm(struct cmdlineInfo const cmdl
/* bKGD chunk */
if (cmdline.background) {
- doTimeChunk(cmdline, info_ptr);
+ doTimeChunk(cmdline, png_ptr, info_ptr);
- if (cmdline.filterSet != 0)
+ if (cmdline.filterSetSpec)
png_set_filter(png_ptr, 0, cmdline.filterSet);
+@@ -2755,17 +2741,11 @@ convertpnm(struct cmdlineInfo const cmdl
setZlibCompression(png_ptr, cmdline.zlibCompression);