2006.02.07 10:26 "[Tiff] Re: Mega newbie question", by Dermot Paikkos

2006.02.06 17:12 "[Tiff] Mega newbie question", by Dermot Paikkos


I'll apologise in advance as I am very green with C.

I have been reading the docs at awaresystems.com on accessing the
thumbnails within a tiff file. PhotoShop

I am not sure what I am getting back from GetField. If I run the program below I get

Value of GetField = 10124416

Does that mean that the length of the block is 10124416 bytes? Or
just it's unique identifier? this

What I am trying to do is loop from the start of this PHOTOSHOP tag to the end. I want to try and extract the various fields along the way. Ultimately I'd like extract the thumbnail within if one exists but I think I am a way of that yet.

So can someone give me a few tips and possibly explain how to use the return value from TIFFGetField I could make a start.


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


  int hasPSfield;

  TIFF* tif = TIFFOpen("test.tif", "r");
  if (tif == NULL) {
        printf("Failed to open file\n");
   TIFFGetField(tif,TIFFTAG_PHOTOSHOP &hasPSfield);

  if (hasPSfield >= 1) {

  printf("Value of GetField = %d\n", hasPSfield );


  return 0;