Cannot read custom Tag from TIFF

Discussions about image processing and document imaging.
Post Reply
damdow
Posts: 1
Joined: Mon Jun 05, 2017 2:40 pm

Cannot read custom Tag from TIFF

Post by damdow » Mon Jun 05, 2017 2:57 pm

GD Picture version 9.4.0.14
dotNet version 4.5

I am adding a custom Tag to a TIFF. The tag is saved out to a file and I have verified that the tag information is stored in the file by using a hex editor.

However, when I load the file and try to read the custom Tag, it isn't found.

Here is the code I am using to write the custom tag:

Code: Select all

int Test_TAG = 65000;
int MultiPageHandle = GDPictureImaging.CreateGdPictureImageFromByteArray(ImageArray);

GDPictureImaging.TagsSetPreserve(true);
GDPictureImaging.TagSetValueString(MultiPageHandle, (Tags)Test_TAG, TagType.TagTypeASCII, "Test Tag Value");
GDPictureImaging.TiffSaveMultiPageToFile(MultiPageHandle, Filename, TiffCompression.TiffCompressionAUTO);
GDPictureImaging.ReleaseGdPictureImage(MultiPageHandle);
And here is the code to read the custom tag:

Code: Select all

int Test_TAG = 65000;
int MultiPageHandle = GDPictureImaging.TiffCreateMultiPageFromFile(Filename);
GDPictureImaging.TagsSetPreserve(true);

int CurrentTAG;
int TagCount = GDPictureImaging.TagCount(MultiPageHandle);
for (int i = 1; i <= TagCount; i++)
{
  CurrentTAG = (int)GDPictureImaging.TagGetID(MultiPageHandle, i);
  if (CurrentTAG == Test_TAG)
    MessageBox.Show(GDPictureImaging.TagGetValueString(MultiPageHandle, i));
}
Anyone spot what I am doing wrong?

User avatar
Loïc
Site Admin
Posts: 5526
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Cannot read custom Tag from TIFF

Post by Loïc » Fri Jun 09, 2017 10:01 pm

Hi,

Custom tag reading and writing is fully supported starting GdPicture.NET 12. So unfortunately it should not work on a version 9.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests