TIFF and LibTiff Mail List Archive


2012.09.03 15:25 "[Tiff] Help Reading TIFF", by Steve Miller
2012.09.03 15:42 "Re: [Tiff] Help Reading TIFF", by Scott Ribe
2012.09.03 15:53 "Re: [Tiff] Help Reading TIFF", by David Burken

2012.09.03 15:25 "[Tiff] Help Reading TIFF", by Steve Miller

// TIFF.cpp: Defines the entry point for the console application.


#include "stdafx.h"


#include "tiff.h"

#include "tiffconf.h"

#include ""

#include "tiffio.h"

#include "tiffiop.h"

#include "tiffvers.h"

#include "tif_config.h"

#include ""

#include "tif_dir.h"

#include "tif_fax3.h"

#include "tif_predict.h"

#include "uvcode.h"

#pragma comment(lib, "libtiff")

int _tmain(int argc, _TCHAR* argv[])


       TIFF *fpTIFFImage;

       unsigned int height;

       unsigned int width;

       unsigned int BitsPerSample;

       unsigned int *Image = 0;

       unsigned int *stopOnError= 0;

if(fpTIFFImage = TIFFOpen("C:\\Users\\Steve\\Gettysburg020512\\39077g25.tif", "r"))


              //height = TIFFGetField(fpTIFFImage, TIFFTAG_IMAGELENGTH);

              //width = TIFFGetField(fpTIFFImage, TIFFTAG_IMAGEWIDTH);

              height = 5529;

              width = 7079;

              BitsPerSample = TIFFGetField(fpTIFFImage,

              *Image = (unsigned
int)_TIFFmalloc(height*width*BitsPerSample*sizeof(unsigned int));

              TIFFReadRGBAImage(fpTIFFImage, width, height, Image, 0);


       return 0;


I am having trouble getting the TIFFGetField results I think I should. It
is returning a 1 and I know from ASTIFFTAG Viewer I should be getting height
of 5529 and length of 7079.

Any help would be appreciated.