about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-03-20 17:27:10 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-03-20 17:27:10 +0000
commitf336dfc59346a26a045f7e0df0ecba32d904c55e (patch)
tree42a541b2d6d2f313ec4def2ce2b4ed522a9e01a1
parent9f95511f291ecc492e283932064857717678bb19 (diff)
downloadnetpbm-mirror-f336dfc59346a26a045f7e0df0ecba32d904c55e.tar.gz
netpbm-mirror-f336dfc59346a26a045f7e0df0ecba32d904c55e.tar.xz
netpbm-mirror-f336dfc59346a26a045f7e0df0ecba32d904c55e.zip
Release 10.97.06
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@4312 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/pnmtorle.c36
-rw-r--r--doc/HISTORY8
-rw-r--r--other/pamx/window.c2
-rw-r--r--version.mk2
4 files changed, 39 insertions, 9 deletions
diff --git a/converter/other/pnmtorle.c b/converter/other/pnmtorle.c
index 1882fe5d..d61884dd 100644
--- a/converter/other/pnmtorle.c
+++ b/converter/other/pnmtorle.c
@@ -209,12 +209,35 @@ write_rle_data(void) {
 
 
 
+static void
+skip_data(FILE      * const fp,
+          int         const width,
+          int         const height,
+          gray        const maxval,
+          int         const format) {
+
+    xel * xelrow;
+    unsigned int scan;
+
+    MALLOCARRAY(xelrow, width);
+    if (xelrow == NULL)
+        pm_error("Failed to allocate memory for row of %u pixels", width);
+
+    for(scan=0; scan < height; ++scan)
+        pnm_readpnmrow(fp, xelrow, width, maxval, format);
+
+    free(xelrow);
+}
+
+
+
 int
 main(int argc, char **  argv) {
 
     const char * pnmname;
     const char * outname;
     int oflag;
+    int eof;
 
     pnm_init(&argc, argv);
 
@@ -247,18 +270,17 @@ main(int argc, char **  argv) {
 
     hdr.rle_file = rle_open_f( hdr.cmd, outname, "wb" );
 
-    if (header)
+    for (eof = 0; !eof; ) {
         read_pnm_header();
-    else {
-        int eof;
-        for (eof = 0; !eof; ) {
-            read_pnm_header();
+
+        if (header)
+            skip_data(fp, width, height, maxval, format);
+        else {
             rle_addhist(argv, NULL, &hdr);
             write_rle_header();
             write_rle_data();
-
-            pnm_nextimage(fp, &eof);
         }
+        pnm_nextimage(fp, &eof);
     }
     pm_close(fp);
 
diff --git a/doc/HISTORY b/doc/HISTORY
index a3989fe8..51440fe7 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,14 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+22.03.20 BJH  Release 10.97.06
+
+              pamx: Fix bug: top-justifies image in all cases where it should
+              bottom-justify.  Always broken.  (pamx was new in Netpbm 10.34
+              (June 2006).
+
+              pnmtorle: Fix bug: -h works only on first image.
+
 22.02.27 BJH  Release 10.97.05
 
               pamsistoaglyph: Fix invalid memory reference and incorrect
diff --git a/other/pamx/window.c b/other/pamx/window.c
index d907163b..d44008c9 100644
--- a/other/pamx/window.c
+++ b/other/pamx/window.c
@@ -366,7 +366,7 @@ placeImage(viewer * const viewerP,
         pixy = (viewerP->height - height) / 2;
     else {
         if ((pixy < 0) && (pixy + height < viewerP->height))
-            pixy = viewerP->height - viewerP->height;
+            pixy = viewerP->height - height;
         if (pixy > 0)
             pixy = 0;
     }
diff --git a/version.mk b/version.mk
index fef2c67f..5cd4fcb1 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 97
-NETPBM_POINT_RELEASE = 5
+NETPBM_POINT_RELEASE = 6