AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

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

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

Hi,

currently fax2ps has the following behavior:

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)));
 }