有理类型的IFD条目的"value offset"字段只能保存一个偏移量?

The "value offset" field of an IFD entry with a rational type can only hold an offset?

考虑具有有理数类型(UNSIGNED RATIONAL 或 SIGNED RATIONAL)的 IFD 条目。

有理类型的值是 8 个字节。

"value offset" 字段是 4 个字节。

因此,具有有理类型的 IFD 条目的 "value offset" 字段只能保存偏移量(该字段永远不能保存值)。

对吗?

简短版:是。

长版:

TIFF IFD 由 IFD 条目组成,同样由 12 个字节组成,依次包含:

  • 2 字节标记标识符
  • 2 字节类型
  • 4 字节计数
  • 4 字节值或偏移量

引用自TIFF 6.0 spec

Value/Offset

To save time and space the Value Offset contains the Value instead of pointing to the Value if and only if the Value fits into 4 bytes. If the Value is shorter than 4 bytes, it is left-justified within the 4-byte Value Offset, i.e., stored in the lowernumbered bytes. Whether the Value fits within 4 bytes is determined by the Type and Count of the field.

因此,由于有理类型总是至少 8 个字节长,它们永远不会作为“内联”值出现,只能作为文件中其他地方的偏移量 + 值出现。