If I edit the tag using gdpicture and then save it, it is still showing it as a value of 2.
Code: Select all
oGdPictureImaging.TiffOpenMultiPageForWrite(false);
gdImageID = oGdPictureImaging.CreateGdPictureImageFromByteArray(inBytes); // byte[]
// shows NewSubfileType of 0
for (int i = 0; i < oGdPictureImaging.TagCount(gdImageID); i++)
{
Console.WriteLine($"gdImageID after set ----{oGdPictureImaging.TagGetName(gdImageID, i)} - {oGdPictureImaging.TagGetValueString(gdImageID, i)}");
}
// remove tag
var status = oGdPictureImaging.TagSetValueBytes(gdImageID,
Tags.TagNewSubfileType,
TagType.TagTypeLong,
new byte[] { 0 });
// NewSubfileType removed, not shown in list anymore
for (int i = 0; i < oGdPictureImaging.TagCount(gdImageID); i++)
{
Console.WriteLine($"gdImageID after set 2 ----{oGdPictureImaging.TagGetName(gdImageID, i)} - {oGdPictureImaging.TagGetValueString(gdImageID, i)}");
}
// save bytes to file
oGdPictureImaging.SaveAsTIFF(gdImageID, "test.tiff", TiffCompression.TiffCompressionCCITT4);
// load file into new gdpicture image
var img1 = oGdPictureImaging.CreateGdPictureImageFromFile("test.tiff");
// shows NewSubfileType of 2
for (int i = 0; i < oGdPictureImaging.TagCount(img1); i++)
{
Console.WriteLine($"gdImageID after set 1 ----{oGdPictureImaging.TagGetName(img1, i)} - {oGdPictureImaging.TagGetValueString(img1, i)}");
}