Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas029.isp.belgacom.be (localhost [127.0.0.1])
        by inav004.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id j74K5xFp010317
        for <joris.at.lebbeke@skynet.be>; Thu, 4 Aug 2005 22:06:00 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx001.isp.belgacom.be (inmx001.isp.belgacom.be [195.238.2.1])
        by inas029.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id j74K5ruV011359
        for <joris.at.lebbeke@skynet.be>; Thu, 4 Aug 2005 22:05:53 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx001.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id j74K5mgg025146
        for <joris.at.lebbeke@skynet.be>; Thu, 4 Aug 2005 22:05:48 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id j74K18Pd027979;
	Thu, 4 Aug 2005 16:01:12 -0400
Received: from jobs.bradleyloritheo.com (dsl-69-31-90-120.pilosoft.com
	[69.31.90.120])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id j74K16px027976
	for <tiff@lists.maptools.org>; Thu, 4 Aug 2005 16:01:06 -0400
Received: from ellison (ellison.bradleyloritheo.com [192.168.100.3])
	by jobs.bradleyloritheo.com (Postfix) with ESMTP id 915891183D1
	for <tiff@lists.maptools.org>; Thu,  4 Aug 2005 16:01:05 -0400 (EDT)
From: "Bradley Feldman" <bradley@relevantevidence.com>
To: <tiff@lists.maptools.org>
Date: Thu, 4 Aug 2005 16:02:32 -0400
Message-ID: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAl26AvnJDdE2pAhSiEiAYTsKAAAAQAAAAOroavbAvzE+AVKLHlUCvagEAAAAA@relevantevidence.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.6626
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Importance: Normal
Subject: [Tiff] NEWBIE HELP NEEDED: Efficiently changing orientation tags in
	multipage tiff files
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
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/pipermail/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
X-UIDL: 000000000023ceae.00000a28
X-MSP-STORE: Thu, 04 Aug 2005 22:06:03 +0200
Status:   

Hi all:

I'm new to this library and this list and looking for some helpful tips on
writing a routine to quickly and efficiently change the orientation tag of
every page of a multipage file.

I see plenty of examples with single page files, but nothing with
multipagers.

As a primer, I've experimented with tiffset but found it only effects the
first page of a multitiff file.

Likewise, I've written a program that is basically simple loop that reads a
tiff file's directories, sets the orientation tag and writes out the
directory to a new file, but I'm not getting any image data.  How so do I
get the whole input file, page by page with just the orientation changed to
the output file?  I'm obviously missing some steps

Here's some pseudo code I'm using:

  infile = TIFFOpen("input.tif", "r");
  outfile = TIFFOpen("output.tif", "w");
   do {
      TIFFGetFieldDefaulted(infile, TIFFTAG_ORIENTATION, &orientation);
	orientation = newValue;
      TIFFSetField(infile, TIFFTAG_ORIENTATION, orientation);
      if (!TIFFWriteDirectory(outfile)) {
	printf("Error!");
	 (void) TIFFClose(outfile);
	 (void) TIFFClose(infile);
	 exit (-2);
      }
   } while(TIFFReadDirectory(infile));
   TIFFClose(infile);
   TIFFClose(outfile);

Many thanks in advance for any help you can provide me with!

*Bradley

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