about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--converter/other/pngtopam.c12
-rw-r--r--doc/HISTORY3
2 files changed, 12 insertions, 3 deletions
diff --git a/converter/other/pngtopam.c b/converter/other/pngtopam.c
index bfb122cd..1c71a84c 100644
--- a/converter/other/pngtopam.c
+++ b/converter/other/pngtopam.c
@@ -329,6 +329,9 @@ reader_createAllAtOnce(struct pngx * const pngxP,
 
    The Reader object reads the PNG at construction time, stores the entire
    raster, and hands it out as you call reader_read().
+
+   It is essential that *pngxP be already fully set up to read the image
+   (all options set).
 -----------------------------------------------------------------------------*/
     Reader * readerP;
 
@@ -1466,9 +1469,6 @@ convertpng(FILE *             const ifP,
     if (verbose)
         dumpPngInfo(pngxP);
 
-    rasterReaderP = cmdline.byrow ? 
-        reader_createRowByRow(pngxP, ifP) : reader_createAllAtOnce(pngxP, ifP);
-
     if (cmdline.time)
         showTime(pngxP);
     if (tfP)
@@ -1494,6 +1494,9 @@ convertpng(FILE *             const ifP,
     determineOutputType(pngxP, cmdline.alpha, bgColor, pngxP->maxval,
                         &pam.format, &pam.depth, pam.tuple_type);
 
+    rasterReaderP = cmdline.byrow ? 
+        reader_createRowByRow(pngxP, ifP) : reader_createAllAtOnce(pngxP, ifP);
+
     writeNetpbm(&pam, pngxP, rasterReaderP, bgColor,
                 cmdline.alpha, gamma);
 
@@ -1539,3 +1542,6 @@ main(int argc, const char *argv[]) {
 
     return errorLevel;
 }
+
+
+
diff --git a/doc/HISTORY b/doc/HISTORY
index 214e72b1..5edcf422 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -6,6 +6,9 @@ CHANGE HISTORY
 
 not yet  BJH  Release 10.64.00
 
+              pngtopam: fix bug: ignores -gamma.  Introduced in 10.48
+              (September 2009).
+
 13.06.29 BJH  Release 10.63.00
 
               Add pamtowinicon, winicontopam.  Thanks Ludolf Holzheid