如何判断GIF图片是否包含图形控件扩展
How to determine whether a GIF image contains a graphic control extension
1990 CompuServe GIF89a specification 定义了一个 "graphic control extension" 像这样:
The Graphic Control Extension contains parameters used
when processing a graphic rendering block. The scope of this extension is
the first graphic rendering block to follow. The extension contains only
one data sub-block.
This block is OPTIONAL; at most one Graphic Control Extension may precede
a graphic rendering block. This is the only limit to the number of
Graphic Control Extensions that may be contained in a Data Stream.
由于这是块可选的,如何确定任意 GIF 图像是否包含图形控件扩展?
事实证明,规范非常明确地指出 所有 扩展,包括图形控件、纯文本、评论和应用程序扩展,都由0x21
在块的开头。
让我失望的是 GIF 包含位于逻辑屏幕描述符中的标志,表示存在可选的全局颜色 Table 块,但没有这样的标志来表示图形的存在控制扩展(不知道为什么)。它要么紧跟在逻辑屏幕描述符之后,要么不紧随其后。希望这对以后的人有所帮助...
1990 CompuServe GIF89a specification 定义了一个 "graphic control extension" 像这样:
The Graphic Control Extension contains parameters used when processing a graphic rendering block. The scope of this extension is the first graphic rendering block to follow. The extension contains only one data sub-block.
This block is OPTIONAL; at most one Graphic Control Extension may precede a graphic rendering block. This is the only limit to the number of Graphic Control Extensions that may be contained in a Data Stream.
由于这是块可选的,如何确定任意 GIF 图像是否包含图形控件扩展?
事实证明,规范非常明确地指出 所有 扩展,包括图形控件、纯文本、评论和应用程序扩展,都由0x21
在块的开头。
让我失望的是 GIF 包含位于逻辑屏幕描述符中的标志,表示存在可选的全局颜色 Table 块,但没有这样的标志来表示图形的存在控制扩展(不知道为什么)。它要么紧跟在逻辑屏幕描述符之后,要么不紧随其后。希望这对以后的人有所帮助...