The spec requires that the TileOffsets and TileByteCounts entries that don't fit in the directory should immediately follow the directory. Given that reading those entries is deferred when opening the Directory, wouldn't it be more efficient if those overflow entries be put after all directories instead of after each directory?
i.e. current layout as defined in the spec is
- TIFF / BigTIFF signature
- IFD (Image File Directory of full resolution image
- Values of TIFF tags that don't fit inline in the IFD directory, such as TileOffsets?, TileByteCounts? and GeoTIFF keys
- Optional: IFD (Image File Directory) of first overview (typically subsampled by a factor of 2), followed by the values of its tags that don't fit inline
- Optional: IFD (Image File Directory) of second overview (typically subsampled by a factor of 4), followed by the values of its tags that don't fit inline
- ...
- Optional: IFD (Image File Directory) of last overview (typically subsampled by a factor of 2N), followed by the values of its tags that don't fit inline
- Optional: tile content of last overview level
- ...
- Optional: tile content of first overview level
- Tile content of full resolution image.
Rearanging it to the following layout would allow the whole image structure to be read with a much smaller GET request. The TileOffsets and TileByteCounts can either be interleaved with the image data (as shown) or all be included between the last IFD and the first block of image contents:
- TIFF / BigTIFF signature
- IFD (Image File Directory of full resolution image
- Values of TIFF tags that don't fit inline in the IFD directory, except for TileOffsets, TileByteCounts
- Optional: IFD (Image File Directory) of first overview (typically subsampled by a factor of 2), followed by the values of its tags that don't fit inline (except for TileOffsets, TileByteCounts)
- Optional: IFD (Image File Directory) of second overview (typically subsampled by a factor of 4), followed by the values of its tags that don't fit inline (except for TileOffsets, TileByteCounts)
- ...
- Optional: IFD (Image File Directory) of last overview (typically subsampled by a factor of 2N), followed by the values of its tags that don't fit inline (except for TileOffsets, TileByteCounts)
- Optional: TileOffsets and TileByteCounts of last overview level
- Optional: tile content of last overview level
- ...
- Optional: TileOffsets and TileByteCounts of first overview level
- Optional: tile content of first overview level
- TileOffsets and TileByteCounts of full resolution image
- Tile content of full resolution image.
The spec requires that the TileOffsets and TileByteCounts entries that don't fit in the directory should immediately follow the directory. Given that reading those entries is deferred when opening the Directory, wouldn't it be more efficient if those overflow entries be put after all directories instead of after each directory?
i.e. current layout as defined in the spec is
Rearanging it to the following layout would allow the whole image structure to be read with a much smaller GET request. The TileOffsets and TileByteCounts can either be interleaved with the image data (as shown) or all be included between the last IFD and the first block of image contents: