9. 注释扩展块
注释扩展块(Comment Extension)域的内容用来说明图形、作者或者其他任何非图形数据和控制信息的文本信息。
注释扩展块的结构如图所示。其中的注释数据是序列数据子块(Data Sub-blocks),每块最多255个字节,最少1个字节。
|
7 6 5 4 3 2 1 0 |
字节号 |
域的名称 |
数据类型 |
|
Extension Introducer (0x21) |
0 |
扩展导入符 |
Byte |
|
Comment Label (0xFE) |
1 |
注释标签 |
Byte |
|
Comment Data |
0 |
注释数据 |
|
|
|
|
|
Data Sub-blocks |
|
|
… |
|
|
|
|
N-1 |
|
|
|
Block Terminator |
|
块结束符 |
Byte |
注释扩展块
10. 应用扩展块
应用扩展块(Application Extension)包含制作该图像文件的应用程序的相关信息,它的结构如图所示。
|
7 6 5 4 3 2 1 0 |
字节号 |
域的名称 |
数据类型 |
|
Extension Introducer (0x21) |
0 |
扩展导入符 |
Byte |
|
Extension Label (0xFF) |
1 |
扩展标签 |
Byte |
|
Block Size |
0 |
块大小 |
Byte |
|
|
1 |
|
|
|
|
2 |
|
|
|
|
3 |
|
|
|
Application Identifier |
4 |
应用程序标识符 |
8 Bytes |
|
|
5 |
(程序名称) |
|
|
|
6 |
|
|
|
|
7 |
|
|
|
|
8 |
|
|
|
|
9 |
|
|
|
Appl. Authentication Code |
10 |
应用程序识别码 |
3 Bytes |
|
|
11 |
|
|
|
|
|
|
|
|
Application Data |
|
应用数据 |
Data Sub-blocks |
|
|
|
|
|
|
Block Terminator |
0 |
|
Byte |
应用扩展块
11. GIF文件结束块
结束块(GIF Trailer)表示GIF文件的结尾,它包含一个固定的数值:0x3B。它具有如图所示的结构。
|
7 6 5 4 3 2 1 0 |
域的名称 |
数据类型 |
|
GIF Trailer = 0x3B |
GFI文件结束块 |
Byte |
GIF文件结束块
GIF文件格式
|
块的名称 |
需要 |
标签 |
扩展 |
版本号. |
|
Application Extension(应用扩展) |
Opt. (*) |
0xFF (255) |
yes |
89a |
|
Comment Extension(注释扩展) |
Opt. (*) |
0xFE (254) |
yes |
89a |
|
Global Color Table(全局彩色表) |
Opt. (1) |
none |
no |
87a |
|
Graphic Control Extension(图形控制扩展) |
Opt. (*) |
0xF9 (249) |
yes |
89a |
|
Header(文件头) |
Req. (1) |
none |
no |
N/A |
|
Image Descriptor(图像描述) |
Opt. (*) |
0x2C (044) |
no |
87a (89a) |
|
Local Color Table(局部彩色表) |
Opt. (*) |
none |
no |
87a |
|
Logical Screen Descriptor(逻辑屏幕描述块) |
Req. (1) |
none |
no |
87a (89a) |
|
Plain Text Extension(无格式文本扩展) |
Opt. (*) |
0x01 (001) |
yes |
89a |
|
Trailer(文件结束) |
Req. (1) |
0x3B (059) |
no |
87a |
Unlabeled Blocks(无标号块)
|
Header(文件头) |
Req. (1) |
none |
no |
N/A |
|
Logical Screen Descriptor(逻辑屏幕描述块) |
Req. (1) |
none |
no |
87a (89a) |
|
Global Color Table(全局彩色表) |
Opt. (1) |
none |
no |
87a |
|
Local Color Table(局部彩色表) |
Opt. (*) |
none |
no |
87a |
Graphic-Rendering Blocks(图像描绘块)
|
Plain Text Extension(无格式文本扩展) |
Opt. (*) |
0x01 (001) |
yes |
89a |
|
Image Descriptor(图像描述块) |
Opt. (*) |
0x2C (044) |
no |
87a (89a) |
Control Blocks(控制块)
|
Graphic Control Extension(图形控制扩展) |
Opt. (*) |
0xF9 (249) |
yes |
89a |
Special Purpose Blocks(专用块)
|
Trailer(结束) |
Req. (1) |
0x3B (059) |
no |
87a |
|
Comment Extension(注释扩展) |
Opt. (*) |
0xFE (254) |
yes |
89a |
|
Application Extension(应用程序扩展) |
Opt. (*) |
0xFF (255) |
yes |
89a |
表中:Req. (1) 表示最多出现一次
Opt. (*) 出现次数大于等于0

本文深入探讨了GIF文件格式中的注释扩展块和应用扩展块。注释扩展块用于存储图形的说明文本信息,由序列数据子块组成。应用扩展块则包含图像文件制作应用的相关信息。最后,文章提到了GIF文件的结束块作为文件的终结标识。
343

被折叠的 条评论
为什么被折叠?



