AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1993.11.22 11:58 "tiff tools", by Hannes Waldmann
1993.11.22 14:25 "Re: tiff tools", by Karsten Spang

1993.11.22 14:25 "Re: tiff tools", by Karsten Spang

Now I wonder how to change the contents of a single tag field of a given file. I assumed I can do it by means of TIFFOpen and TIFFSetField, but the man page of TIFFOpen says "If an existing file is opened for writing, all previous data is overwritten."

So does this mean there isn't a way to easily change single fields?

I think you are right. A possible way of doing this, might be to TIFFOpen for append, the TIFFSetDirectory to the first, do TIFFSetField, and TIFFClose. HOWEVER, I recall that someone tried this, and it did *not* work. The only thing that works, is to copy the file, changing the fields along the way. You may use a modified version of the code in tiffcp.

                                 Karsten

--------------------------------------------------------------------------------
E-mail: krs@kampsax.dk                                      Karsten Spang
Phone:  +45 36 77 22 23                                     Kampsax Data
Fax:    +45 36 77 03 01                                     P.O. Box 1142
                                                            DK-2650 Hvidovre
                                                            Denmark