2018.02.24 20:20 "Re: [Tiff] writing custom tags to Tiff file and reading out", by Stephen Morris
I am trying to add custom tags to a tiff file.
I am able to merge the custom fields to TIFFFields using TIFFMergeFieldInfo, but not able to write it out to tiff file.
Anyone has an idea about how to write the merged information to Tiff and read it back the custom fields.
I need a similar program like this https://stackoverflow.com/questions/24059421/adding-custom-tags-to-a-tiff-file
Note: In above program, I am not able to find the function definition for "
readFromPGM(&nx, &ny, &image, "TestImage.pgm");"
The link you gave was to my question and answer; the 'readFromPGM' function was one I wrote myself to read an image stored in PGM format, which is a quite rare format but the only one I know apart from TIFF that can store 16-bit monochrome images. My code had been storing the images as .pgm files, and the tags in a separate XML file, until I figured out how to combine everything into a single .TIF file.
If you're not using 16-bit monochrome images, then you can load your test image from anywhere you like, using a more conventional format such as JPEG.
Even so, I'll send you my readFromPGM code (it's about 100 lines) directly. If there's anywhere I can post it for general reference, perhaps the moderators could let me know.