0

I have a requirement where I need to read couple of Tiff tags from a input Tiff file. As user can provide any tag ID to read. For this, I need to know the type of the value of that tag so that i can read the tag and return the value to user.

const char* filename = "C:\\test\\Modified.tif";

TIFF* mtif = TIFFOpen(filename, "r");
uint16 flor, w, h;
uint16 gotcount = 0;
TIFFGetField(mtif, TIFFTAG_FILLORDER, &flor);
TIFFGetField(mtif, TIFFTAG_IMAGEWIDTH, &w);
TIFFGetField(mtif, TIFFTAG_IMAGELENGTH, &h);

I am using LibTif library. Here all i am able to read the width and height properly whereas fillorder tag value is not being received.

I opened the file in a Tiff editor and can see that FillOrder has valid value. enter image description here

Can someone help me in this? Thanks.

Nihal Kumar
  • 305
  • 3
  • 16
  • What have you tried? What language are you using? – matt Jul 02 '20 at 11:59
  • I am using C++. I tried reading the tags using TIFFGetField(). But here the type of the value should be known so that you can pass the proper variable and get the value. – Nihal Kumar Jul 02 '20 at 12:04
  • What tag is it? Can you include the code you're using to do this. I am having trouble understanding what you mean by "the proper variable". – matt Jul 02 '20 at 12:16
  • Is the tag in this list, http://www.libtiff.org/man/TIFFGetField.3t.html – matt Jul 02 '20 at 12:17

0 Answers0