about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-01-23 03:40:27 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-01-23 03:40:27 +0000
commitfb09918a6f41da4e507f43b99be7cfb43bb4bed1 (patch)
treeed0e3f6699f87818af5836d6170d507e0d985211
parent66e79ae951e3282572a059fcf86408d5f93728e8 (diff)
downloadnetpbm-mirror-fb09918a6f41da4e507f43b99be7cfb43bb4bed1.tar.gz
netpbm-mirror-fb09918a6f41da4e507f43b99be7cfb43bb4bed1.tar.xz
netpbm-mirror-fb09918a6f41da4e507f43b99be7cfb43bb4bed1.zip
fix some of -interlace handling, but it still doesn't work
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3520 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/pnmtopng.c15
-rw-r--r--doc/HISTORY4
2 files changed, 14 insertions, 5 deletions
diff --git a/converter/other/pnmtopng.c b/converter/other/pnmtopng.c
index e40e72cb..1ee76513 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,10 @@ convertpnm(struct cmdlineInfo const cmdline,
         pm_error ("setjmp returns error condition (2)");
     }
 
-    doIhdrChunk(pngxP, cols, rows, depth, colorMapped, colorPng, alpha);
+    doIhdrChunk(pngxP, cols, rows, depth, colorMapped, colorPng, alpha,
+                cmdline.interlace);
 
-    if (cmdline.interlace)
-        pngx_setInterlaceHandling(pngxP);
+    pngx_setInterlaceHandling(pngxP);
 
     doGamaChunk(cmdline, pngxP);
 
diff --git a/doc/HISTORY b/doc/HISTORY
index 94eafeee..1a7b4ec8 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -22,6 +22,10 @@ not yet  BJH  Release 10.86.00
               various: Fix unnormalizing code so a value exactly between two
               sample values rounds consistently up.  Affects many programs.
 
+              pnmtopng: fix -interlace, sort of.  Previously, it was ignored.
+              Now it produces an image that is ostensibly interlaced, but
+              seems to be invalid.
+
               pamstretch: Reject very large scale factors instead of producing
               incorrect output.