Received: by cthulhu.engr.sgi.com (941129.SGI.8.6.9/911001.SGI)
	for tiff-list id HAA19531; Tue, 10 Jan 1995 07:12:25 -0800
Return-Path: <owner-tiff>
Received: from sgi.sgi.com by cthulhu.engr.sgi.com via ESMTP (941129.SGI.8.6.9/911001.SGI)
	for <tiff-relay@cthulhu.engr.sgi.com> id HAA19526; Tue, 10 Jan 1995 07:12:19 -0800
Received: from radar.oslo.dnmi.no by sgi.sgi.com via SMTP (941129.SGI.8.6.9/910110.SGI)
	for <tiff@sgi.com> id HAA10136; Tue, 10 Jan 1995 07:12:12 -0800
Received: by radar.oslo.dnmi.no (931110.SGI/930416.SGI)
	for tiff@sgi.com id AA11818; Tue, 10 Jan 95 15:12:10 GMT
From: "Oystein Godoy" <oystein.godoy@dnmi.no>
Message-Id: <9501101512.ZM11816@radar.oslo.dnmi.no>
Date: Tue, 10 Jan 1995 15:12:10 +0000
X-Mailer: Z-Mail (3.1.0 22feb94 MediaMail)
To: tiff@sgi.sgi.com
Subject: Problem with tiff-v3.3beta021
Cc: faog@radar.oslo.dnmi.no
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Sender: owner-tiff@sgi.sgi.com
Precedence: bulk

Hi!

I have some trouble with tiff-v3.3beta021. The library is being used on a SGI
INDY running IRIX 5.2.

My problem is related to the routine TIFFGetField and I have directed the
problem to various NEWS groups as well - with no success. The files I have been
testing at shows correct information using tiffdump. Furthermore, I have tested
my program using both cc and gcc 2.6.3.

Description of the problem:
When I use TIFFGetField to read the different fields correct information is
gained from: TIFFTAG_IMAGEWIDTH, TIFFTAG_IMAGELENGTH, TIFFTAG_BITSPERSAMPLE,
TIFFTAG_COMPRESSION, TIFFTAG_IMAGEDESCRIPTION, TIFFTAG_PHOTOMETRIC,
TIFFTAG_STRIPOFFSETS, TIFFTAG_SAMPLESPERPIXEL and TIFFTAG_PLANARCONFIG while
incorrect information is gained from TIFFTAG_ROWSPERSTRIP and
TIFFTAG_STRIPBYTECOUNTS. The incorrect information show no resemblance with the
"real" information.

Do You have any idea of what I am doing wrong?? I have run out of ideas.......

	Sincerely
	Oystein

PS I have included part of the program:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "/usr/local/tiff-v3.3beta021/libtiff/tiffio.h"

main()
{
  TIFF *in;
  uint32 imagewidth, imageheight, *offset;
  uint16 samplesperpixel;
  uint32 rowsperstrip;
  uint32 *stripbytecounts;
  uint16 bitspersample, compression, photomint, plcf;
  char filename[19]= {"../data/test.tif"};

/* Open TIF file for reading of IFD and image data */

  in=TIFFOpen(filename, "r");

/* Read TIF tag information that is needed in the fortran program */

  TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &imagewidth);
  TIFFGetField(in, TIFFTAG_IMAGELENGTH, &imageheight);
  TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample);
  TIFFGetField(in, TIFFTAG_COMPRESSION, &compression);
  TIFFGetField(in, TIFFTAG_IMAGEDESCRIPTION, &description);
  TIFFGetField(in, TIFFTAG_PHOTOMETRIC, &photomint);
  TIFFGetField(in, TIFFTAG_STRIPOFFSETS, &offset);
  TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel);
  TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
  TIFFGetField(in, TIFFTAG_STRIPBYTECOUNTS, &stripbytecounts);
  TIFFGetField(in, TIFFTAG_PLANARCONFIG, &plcf);

  printf("%s %u\n", " Image width= ", imagewidth);
  printf("%s %u\n", " Image height= ", imageheight);
  printf("%s %u\n", " Bits per Sample= ", bitspersample);
  printf("%s %u\n", " Compression= ", compression);
  printf("%s %d\n", " Photometric= ", photomint);
  printf("%s %u\n", " Strip offsets= ", *offset);
  printf("%s %u\n", " Samples per pixel= ", samplesperpixel);
  printf("%s %lu\n", " Rows per strip= ", rowsperstrip);
  printf("%s %lu\n", " Strip byte counts: ", *stripbytecounts);
  printf("%s %u\n", " Planar Configuration: ", plcf);

  printf("\n%s %s\n", " Description: ", description);

/* Close TIF file that have been used */

  TIFFClose(in);

  return;
}



