https://github.com/libsdl-org/libtiff/commit/a09c34b5d52ec9a057019b268f073739d297aa13
From a09c34b5d52ec9a057019b268f073739d297aa13 Mon Sep 17 00:00:00 2001
From: Lee Howard <[EMAIL REDACTED]>
Date: Tue, 14 Dec 2010 03:17:22 +0000
Subject: [PATCH] * tools/fax2ps.c: be consistent with page-numbering
http://bugzilla.maptools.org/show_bug.cgi?id=2225
---
ChangeLog | 5 +++++
tools/fax2ps.c | 6 +++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 84d4d64a..fef8a936 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-13 Lee Howard <faxguy@howardsilvan.com>
+
+ * tools/fax2ps.c: be consistent with page-numbering
+ http://bugzilla.maptools.org/show_bug.cgi?id=2225
+
2010-12-13 Lee Howard <faxguy@howardsilvan.com>
* libtiff/tif_dirread.c: fix needless tag ordering warning
diff --git a/tools/fax2ps.c b/tools/fax2ps.c
index 6c94e3ea..21bbd853 100644
--- a/tools/fax2ps.c
+++ b/tools/fax2ps.c
@@ -1,4 +1,4 @@
-/* $Id: fax2ps.c,v 1.22.2.2 2010-12-12 01:12:29 faxguy Exp $" */
+/* $Id: fax2ps.c,v 1.22.2.3 2010-12-14 03:17:22 faxguy Exp $" */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -273,9 +273,9 @@ findPage(TIFF* tif, uint16 pageNumber)
uint16 pn = (uint16) -1;
uint16 ptotal = (uint16) -1;
if (GetPageNumber(tif)) {
- while (pn != pageNumber && TIFFReadDirectory(tif) && GetPageNumber(tif))
+ while (pn != (pageNumber-1) && TIFFReadDirectory(tif) && GetPageNumber(tif))
;
- return (pn == pageNumber);
+ return (pn == (pageNumber-1));
} else
return (TIFFSetDirectory(tif, (tdir_t)(pageNumber-1)));
}