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
August 2005

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

2005.08.04 20:02 "changing orientation tags in multipage tiff files", by Bradley Feldman
2005.08.04 23:42 "Re: changing orientation tags in multipage tiff files", by Bradley Feldman
2005.08.04 23:50 "Re: changing orientationtags in multipage tiff files", by Joris Van Damme

2005.08.04 20:02 "changing orientation tags in multipage tiff files", by Bradley Feldman

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