2006.02.06 17:12 "[Tiff] Mega newbie question", by Dermot Paikkos
Hi,
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
is
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.
Thanx.
Dp.
=======================
#include <stdio.h>
#include <tiffio.h>
main()
{
int hasPSfield;
TIFF* tif = TIFFOpen("test.tif", "r");
if (tif == NULL) {
printf("Failed to open file\n");
exit(8);
}
TIFFGetField(tif,TIFFTAG_PHOTOSHOP &hasPSfield);
if (hasPSfield >= 1) {
printf("Value of GetField = %d\n", hasPSfield );
}
TIFFClose(tif);
return 0;
}
=========================