Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-r.b-one.net (mx-r.one.com [91.198.169.249])
	by mail9.b-one.net (Postfix) with ESMTP id F2211400107
	for <info@awaresystems.be>; Wed, 30 Jun 2010 21:45:58 +0200 (CEST)
Received: by mx-r.b-one.net (Postfix, from userid 106)
	id 99C0B6D2E1F1; Wed, 30 Jun 2010 21:45:58 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Spam-Flag: NO
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=4 tests=[none]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-r.b-one.net (Postfix) with ESMTP id 71E5E6D2E1E9 for
 <info@awaresystems.be>; Wed, 30 Jun 2010 21:45:57 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id 31B761D0CDF14; Wed, 30 Jun 2010
 14:42:59 -0500 (EST)
Received: from fr.prnet.org (fr.prnet.org [91.121.181.205]) by
 lists.maptools.org (Postfix) with ESMTPS id B86431D0E524A for
 <tiff@lists.maptools.org>; Wed, 30 Jun 2010 14:38:35 -0500 (EST)
Received: from [192.168.1.1] (ip-213-135-240-128.static.luxdsl.pt.lu
 [213.135.240.128]) (authenticated bits=0) by fr.prnet.org (8.14.4/8.14.0)
 with ESMTP id o5UJcTI1010791 (version=TLSv1/SSLv3
 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for
 <tiff@lists.maptools.org>; Wed, 30 Jun 2010 21:38:29 +0200
Message-ID: <4C2B9D35.8050302@prnet.org>
Date: Wed, 30 Jun 2010 21:38:29 +0200
From: David Arendt <admin@prnet.org>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.4)
 Gecko/20100629 Thunderbird/3.1
MIME-Version: 1.0
To: tiff@lists.maptools.org
Content-Type: multipart/mixed; boundary="------------060603050606050008060907"
Subject: [Tiff] fax2ps pagenumber patch
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

This is a multi-part message in MIME format.
--------------060603050606050008060907
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

 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


--------------060603050606050008060907
Content-Type: text/plain;
 name="fax2pspagenumber.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="fax2pspagenumber.patch"

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


--------------060603050606050008060907
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
--------------060603050606050008060907--
