Skip to content
  • Facundo Tuesca's avatar
    Add field to keep track of last written directory · baf74f64
    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.
    baf74f64