diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-02-10 07:34:34 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-02-10 07:34:34 +0000 |
commit | e91b7794264ef6af3856fd54373def89d3a949a9 (patch) | |
tree | e5fe2470079132889f57c94a1ee94af1e9c31a9e /converter/other | |
parent | b69ed32eefbedb589d1b521d884bd511e2db3fdf (diff) | |
download | netpbm-mirror-e91b7794264ef6af3856fd54373def89d3a949a9.tar.gz netpbm-mirror-e91b7794264ef6af3856fd54373def89d3a949a9.tar.xz netpbm-mirror-e91b7794264ef6af3856fd54373def89d3a949a9.zip |
Release 10.85.02
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3545 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other')
-rw-r--r-- | converter/other/pnmtopng.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/converter/other/pnmtopng.c b/converter/other/pnmtopng.c index cf053f7e..08263f29 100644 --- a/converter/other/pnmtopng.c +++ b/converter/other/pnmtopng.c @@ -2436,7 +2436,11 @@ doIhdrChunk(struct pngx * const pngxP, unsigned int const depth, bool const colorMapped, bool const colorPng, - bool const alpha) { + bool const alpha, + bool const interlace) { + + int const interlaceMethod = + interlace ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE; int colorType; @@ -2450,7 +2454,8 @@ doIhdrChunk(struct pngx * const pngxP, if (alpha && colorType != PNG_COLOR_TYPE_PALETTE) colorType |= PNG_COLOR_MASK_ALPHA; - pngx_setIhdr(pngxP, width, height, depth, colorType, 0, 0, 0); + pngx_setIhdr(pngxP, width, height, depth, colorType, + interlaceMethod, 0, 0); } @@ -2820,10 +2825,8 @@ convertpnm(struct cmdlineInfo const cmdline, pm_error ("setjmp returns error condition (2)"); } - doIhdrChunk(pngxP, cols, rows, depth, colorMapped, colorPng, alpha); - - if (cmdline.interlace) - pngx_setInterlaceHandling(pngxP); + doIhdrChunk(pngxP, cols, rows, depth, colorMapped, colorPng, alpha, + cmdline.interlace); doGamaChunk(cmdline, pngxP); @@ -2875,6 +2878,8 @@ convertpnm(struct cmdlineInfo const cmdline, /* let libpng take care of, e.g., bit-depth conversions */ pngx_setPacking(pngxP); + pngx_setInterlaceHandling(pngxP); + writeRaster(pngxP, ifP, rasterPos, cols, rows, maxval, format, pngMaxval, depth, alpha, alpha_mask, cht, caht); |