i want to set or change some Tags in a Multi-TIFF-File with LibTiff.net. So im currently switching through the Sub-Images with SetDirectory(), updating some fields and checking out with the CheckpointDirectory()-Function. When im doing this, only the first image in the generated Multi-TIFF-File is visible, the others are completely black. That even happens without changing any tag with the following code. What point am i missing ?
If i set the CheckoutDirectory function outside the For loop, all the pictures will be displayed as desired, but I want to change the tags of all SubTiffs, not just the ones of the last one.
public static void setRequiredTags(string outputFilePath)
{
using (Tiff image_MultiTIFF = Tiff.Open(outputFilePath, "a"))
{
for (int i = 0; i < image_MultiTIFF.NumberOfDirectories(); i++)
{
// Load the Next Sub-TIFF
image_MultiTIFF.SetDirectory((short)i);
// setting custom tag
// image_MultiTIFF.SetField(TiffTag.PAGENUMBER, i, image_MultiTIFF.NumberOfDirectories());
// image_MultiTIFF.SetField(TiffTag.DATETIME, DateTime.Now);
// rewrites directory saving new tag
image_MultiTIFF.CheckpointDirectory();
}
}
}