Tiff 与 BigTiff

Tiff versus BigTiff

如果有另一个 Stack Exchange 社区更适合这个问题,请告诉我。

我想了解 Tiff 和 BigTiff 之间的基本区别。我查看了各种站点,提到的唯一区别是 BigTiff 使用 64 位偏移,而 Tiff 使用 32 位偏移。话虽如此,您需要知道您正在阅读的是两种类型中的哪一种。这是怎么做到的?根据https://www.leadtools.com/help/leadtools/v19/main/api/tifffmt.html, this is done by reading a file flag. However, the flag they are referring to appears to be unique to their own reader as I cannot find a corresponding data field in the specifications as shown by http://www.fileformat.info/format/tiff/egff.htm。我错过了什么? BigTiff 使用与 Tiff 不同的文件头吗?

您需要知道的一切都在@cgohlke 发布的 the BigTIFF link 中进行了描述。这只是为了回答您的问题:

是的,它使用不同的文件 header。

普通TIFF使用以下header:

  • 2字节字节顺序标记,"II"代表"Intel"/little endian,或者"MM"代表"Motorola"/big endian。
  • (版本)号 42* 作为 16 位值,以给定的字节序表示。
  • IFD0 的无符号 32 位偏移量

BigTIFF 使用略有不同 header:

  • 2 byte字节序标记同上
  • (版本)编号 43 作为 16 位值,按照给定的字节顺序。
  • 偏移量的字节大小为 16 位值,BigTIFF 始终为 8
  • 2 字节填充,BigTIFF 始终为 0
  • IFD0 的无符号 64 位偏移量

*) 选择值 42 是因为它的 "deep philosophical significance"。或者按照官方规定,[a]n个任意但慎重选择的数字...