.net - LibTiff.net Not able to update EXIF_USERCOMMENT field -
I just want to update the tif image on the The call to Here's my very simple code. Any help would be appreciated. Unfortunately, it seems that LibTiff.Net only read EXIF tags Can not write them and write them (original libtiff can not write EXIF tag either) That's why it's why. Here are some quotes from the discussion: Bob Frisenhaughn: But the library will still not be able to write the EXIF tag to file. Edit: You have some options if you only want to store some information in your file and do this by You can use the EXIF_USERCOMMENT field I am making
SetField fails. Not sure what I'm doing wrong
{TIFF tiffdoc = Tiff.Open ("C: \ temp \\ ~ tempCapture.tif", "RW"); Bool bSetField = tiffdoc.SetField (TiffTag.EXIF_USERCOMMENT, "Test Comment Field"); Tiffdoc.WriteDirectory (); Tiffdoc.close (); }
// FIXME - We currently do not support writing EXIF fields. In TIFF // theory this allows the use of the custom IFD directory, but at present, it seems that libtiff only supports readings / IFD readings, not written to them. Leonard Rossenthal:
I really do not think Liberif really wants to start metadata "Rabbit Hole" ...
I agree with Leonard Rosenthal that Libertif should not be in business with the handling of the XF private IFD tag (even if it is already already )
For unknown tags EXIF_USERCOMMENT , you must add the library EXIF tag to the list of known tags before reading the EXIF directory and later unknown The tag will not issue an error.
EXIF_USERCOMMENT There is no need to store in the tag.
IMAGEDESCRIPTION tag for your work below is the sample code that uses this tag. Please note that the code uses different parametr for the
open method and also uses
RewriteDirectory instead of
WriteDirectory .
string filename = "c: \\ temp \\ ~ tempCapture.tif"; Use (TIFF Tiffdock = TIFF Open (Filename, "A")) {tiffdoc.SetDirectory (0); bool bSetField = tiffdoc.SetField (TiffTag.IMAGEDESCRIPTION, "Test Comment Field"); Tiffdoc.RewriteDirectory (); }
Comments
Post a Comment