AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
June 2010

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2010.06.30 19:38 "fax2ps pagenumber patch", by David Arendt
2010.06.30 20:44 "Re: fax2ps pagenumber patch", by Bob Friesenhahn

2010.06.30 19:38 "fax2ps pagenumber patch", by David Arendt

 Hi,

currently fax2ps has the following behavior:

- if a tiff file contains no page number tags, -p 1 specifies the first page
- if a tiff file contains page number tags, -p 0 specifies the first page

this makes usage in batch processing of files difficult

This patch changes fax2ps behavior to have -p 1 always designate the
first page.

Bye,
David Arendt

--- fax2ps.c.orig	2010-06-24 20:22:04.405221464 +0200
+++ fax2ps.c	2010-06-24 20:22:56.601976275 +0200
@@ -277,9 +277,9 @@
     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)));
 }