-
Facundo Tuesca authored
This adds a new `tif_lastdiroff` field to the TIFF data structure and uses it to store the offset of the last written directory. Appending a new directory required traversing the whole file to find the last directory. By keeping track of its offset in this new field, the search is no longer necessary. Since this offset is only stored in-memory, the first directory append after opening a file will have to transverse the whole directory list. Subsequent calls will have access to the last offset, avoiding the transversal.