2006.01.31 10:17 "[Tiff] RowsPerStrip", by Harsha

2006.01.31 10:17 "[Tiff] RowsPerStrip", by Harsha

Dear all,

I have created a Tiff Image of Width 100 and Height 400. I set the Rows Per Strip as 400.

So If I am not wrong, I have only one strip which contains 400 Rows i.e, Only one strip. I have Tiff Tag Vieer from Lead Tools. Which shows Rows Per Strip as 400. Manually, I open the Tiff file in Binary mode and searched for number 278 (i.e., 16 01 03 00 01 00 00 00 90 01 00 00) and RowsPerStrip is 400. But When I asked for RowsPerStrip using LibTiff I received 81.

Here is my program which asks for RowsPerStrip, Plesae correct me if I am wrong.

  #include <stdio.h>
#include <tiffio.h>
#include <windows.h>

int main(){
  TIFF *image;
  tsize_t stripSize;
    int stripMax;
    unsigned long bufferSize, count;
  short RowsPerStrip;
    FILE *fp;
    // Open the TIFF image
  if((image = TIFFOpen("TestImage.tif", "r")) == NULL)
  {
    fprintf(stderr, "Could not open incoming image\n");
    exit(42);
  }
    // Read in the possibly multiple strips
  stripSize = TIFFStripSize (image);
  stripMax = TIFFNumberOfStrips (image);
    bufferSize = TIFFNumberOfStrips (image) * stripSize;
    TIFFGetField(image, 278, &RowsPerStrip);
    printf("Rows Per Strip: %u\n", RowsPerStrip);
    TIFFClose(image);
  return 0;
}

Thanks and Regards
Harsha

---------------------------------
Do you Yahoo!?
 With a free 1 GB, there's more in store with Yahoo! Mail.