Hi folkes
I use following code to print all IFD Entry Tags of an NEF File (TIFF):
Code:
OpenFile("Bsp.NEF");
char byte[2];
unsigned long step = 10;
unsigned long tmp = 0;
fseek(pFile, 8, SEEK_SET);
fread (&byte[0], 1, 1, pFile);
fread (&byte[1], 1, 1, pFile);
unsigned long count = (byte[0] << 8) | byte[1];
for (int a = 0; a <= count; a++)
{
fseek ( pFile , step , SEEK_SET );
fread (&byte[0], 1, 1, pFile);
fread (&byte[1], 1, 1, pFile);
tmp = (byte[0] << 8) | byte[1];
cout << "Offset: " << step << " Tag: " << tmp << endl;
step = step + 12;
}
CloseFile();
the output I get is following:
PHP Code:
...
Offset: 226 Tag: 306
Offset: 238 Tag: 330
Offset: 250 Tag: 532
Offset: 262 Tag: 4294967228
As you can see at Offset 262 the tag name shows a full unsinged long value instead of the supposed 34665.
I have really no idea why at this point the reading fails.