0N/A<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2362N/ACopyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. 0N/ADO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/AThis code is free software; you can redistribute it and/or modify it 0N/Aunder the terms of the GNU General Public License version 2 only, as 2362N/Apublished by the Free Software Foundation. Oracle designates this 0N/Aparticular file as subject to the "Classpath" exception as provided 2362N/Aby Oracle in the LICENSE file that accompanied this code. 0N/AThis code is distributed in the hope that it will be useful, but WITHOUT 0N/AANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/AFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/Aversion 2 for more details (a copy is included in the LICENSE file that 0N/Aaccompanied this code). 0N/AYou should have received a copy of the GNU General Public License version 0N/A2 along with this work; if not, write to the Free Software Foundation, 0N/AInc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2365N/APlease contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A<
title>GIF Metadata Format Specification</
title>
0N/A<
body bgcolor="white">
0N/AGIF Metadata Format Specification
0N/A<
a name="gif_stream_metadata_format">
0N/AGIF Stream Metadata Format Specification
0N/AThe GIF stream metadata format encodes the information stored in the
0N/Aper-file header, namely the file version, logical screen descriptor,
0N/Aand the global color table.
0N/AThe logical screen descriptor describes the overall width and height
0N/Aof an animated file, as well as information about the color resolution
0N/A(number of bits per pixel) and pixel aspect ratio.
0N/AThe global color table contains a color lookup table that is used for
0N/Aimages that do not have their own local color table.
0N/A<!DOCTYPE "javax_imageio_gif_stream_1.0" [
0N/A <!ELEMENT "javax_imageio_gif_stream_1.0" (Version?,
0N/A LogicalScreenDescriptor?, GlobalColorTable?)>
0N/A <!ELEMENT "Version" EMPTY>
0N/A <!-- The file version, either 87a or 89a -->
0N/A <!ATTLIST "Version" "value" ("87a" | "89a") #REQUIRED>
0N/A <!-- The version string -->
0N/A <!ELEMENT "LogicalScreenDescriptor" EMPTY>
0N/A <!-- The logical screen descriptor, except for the global color table -->
0N/A <!ATTLIST "LogicalScreenDescriptor" "logicalScreenWidth" #CDATA
0N/A <!-- The width in pixels of the whole picture -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 1 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "LogicalScreenDescriptor" "logicalScreenHeight" #CDATA
0N/A <!-- The height in pixels of the whole picture -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 1 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "LogicalScreenDescriptor" "colorResolution" #CDATA
0N/A <!-- The number of bits of color resolution, beteen 1 and 8 -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 1 (inclusive) -->
0N/A <!-- Max value: 8 (inclusive) -->
0N/A <!ATTLIST "LogicalScreenDescriptor" "pixelAspectRatio" #CDATA
0N/A <!-- If 0, indicates square pixels, else W/H = (value + 16)/64 -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A <!ELEMENT "GlobalColorTable" (ColorTableEntry)*>
0N/A <!-- The global color table -->
0N/A <!-- Min children: 2 -->
0N/A <!-- Max children: 256 -->
0N/A <!ATTLIST "GlobalColorTable" "sizeOfGlobalColorTable" ("2" |
0N/A "4" | "8" | "16" | "32" | "64" | "128" | "256") #REQUIRED>
0N/A <!-- The number of entries in the global color table -->
0N/A <!ATTLIST "GlobalColorTable" "backgroundColorIndex" #CDATA
0N/A <!-- The index of the color table entry to be used as a background -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A <!ATTLIST "GlobalColorTable" "sortFlag" ("TRUE" | "FALSE")
0N/A <!-- True if the global color table is sorted by frequency -->
0N/A <!ELEMENT "ColorTableEntry" EMPTY>
0N/A <!-- A global color table entry -->
0N/A <!ATTLIST "ColorTableEntry" "index" #CDATA #REQUIRED>
0N/A <!-- The index of the color table entry -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A <!ATTLIST "ColorTableEntry" "red" #CDATA #REQUIRED>
0N/A <!-- The red value for the color table entry -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A <!ATTLIST "ColorTableEntry" "green" #CDATA #REQUIRED>
0N/A <!-- The green value for the color table entry -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A <!ATTLIST "ColorTableEntry" "blue" #CDATA #REQUIRED>
0N/A <!-- The blue value for the color table entry -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A<
a name="gif_image_metadata_format">
0N/AGIF Image Metadata Format Specification
0N/AThe GIF image metadata format encodes the image descriptor, local
0N/Acolor table, and extension information assciated with a single image
0N/Awithin a GIF file, typically a frame of an animation.
0N/AThe image description contains the offset of the frame within the
0N/Alogical screen described in the stream metadata, as well as the width
0N/Aand height of the frame and whether it is used interlaced encoding.
0N/AThe local color table, if present, supersedes the global color table
0N/Afor the frame at hand.
0N/AThe graphic control extension contains information on how the frame is
0N/Ato be incorporated into the animation. The disposal method indicates
0N/Awhether the current frame should remain in place
0N/A(<
code>doNotDispose</
code>), be restored to the backgound color as
0N/Aspecified in the stream metadata
0N/A(<
code>restoreToBackgroundColor</
code>), or be restored to the
0N/Aprevious frame contents (<
code>restoreToPrevious</
code>) prior to
0N/Adisplaying the subsequent frame.
0N/AThe user input flag indicates whether the animation should pause for
0N/Auser input before advancing to the next frame. The transparent color
0N/Aflag and index indicate a color index for which pixels of the frame
0N/Ashould not be drawn. The delay time indicates how long the frame
0N/Ashould be displayed, in hundredths of a second. If the user input
0N/Aflag is set and the delay time is 0, the frame is intended to be
0N/Aadvanced only on user input.
0N/A<!DOCTYPE "javax_imageio_gif_image_1.0" [
0N/A <!ELEMENT "javax_imageio_gif_image_1.0" (ImageDescriptor?,
0N/A LocalColorTable?, GraphicControlExtension?, PlainTextExtension?,
0N/A ApplicationExtensions?, CommentExtensions?)>
0N/A <!ELEMENT "ImageDescriptor" EMPTY>
0N/A <!-- The image descriptor -->
0N/A <!ATTLIST "ImageDescriptor" "imageLeftPosition" #CDATA #REQUIRED>
0N/A <!-- The X offset of the image relative to the screen origin -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "ImageDescriptor" "imageTopPosition" #CDATA #REQUIRED>
0N/A <!-- The Y offset of the image relative to the screen origin -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "ImageDescriptor" "imageWidth" #CDATA #REQUIRED>
0N/A <!-- The width of the image -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 1 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "ImageDescriptor" "imageHeight" #CDATA #REQUIRED>
0N/A <!-- The height of the image -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 1 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "ImageDescriptor" "interlaceFlag" ("TRUE" | "FALSE")
0N/A <!-- True if the image is stored using interlacing -->
0N/A <!ELEMENT "LocalColorTable" (ColorTableEntry)*>
0N/A <!-- The local color table -->
0N/A <!-- Min children: 2 -->
0N/A <!-- Max children: 256 -->
0N/A <!ATTLIST "LocalColorTable" "sizeOfLocalColorTable" ("2" |
0N/A "4" | "8" | "16" | "32" | "64" | "128" | "256") #REQUIRED>
0N/A <!-- The number of entries in the local color table -->
0N/A <!ATTLIST "LocalColorTable" "sortFlag" ("TRUE" | "FALSE")
0N/A <!-- True if the local color table is sorted by frequency -->
0N/A <!ELEMENT "ColorTableEntry" EMPTY>
0N/A <!-- A local color table entry -->
0N/A <!ATTLIST "ColorTableEntry" "index" #CDATA #REQUIRED>
0N/A <!-- The index of the color table entry -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A <!ATTLIST "ColorTableEntry" "red" #CDATA #REQUIRED>
0N/A <!-- The red value for the color table entry -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A <!ATTLIST "ColorTableEntry" "green" #CDATA #REQUIRED>
0N/A <!-- The green value for the color table entry -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A <!ATTLIST "ColorTableEntry" "blue" #CDATA #REQUIRED>
0N/A <!-- The blue value for the color table entry -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A <!ELEMENT "GraphicControlExtension" EMPTY>
0N/A <!-- A graphic control extension -->
0N/A <!ATTLIST "GraphicControlExtension" "disposalMethod" ("none" |
0N/A "doNotDispose" | "restoreToBackgroundColor" |
0N/A "restoreToPrevious" | "undefinedDisposalMethod4" |
0N/A "undefinedDisposalMethod5" | "undefinedDisposalMethod6" |
0N/A "undefinedDisposalMethod7") #REQUIRED>
0N/A <!-- The disposal method for this frame -->
0N/A <!ATTLIST "GraphicControlExtension" "userInputFlag" ("TRUE" |
0N/A "FALSE") #REQUIRED>
0N/A <!-- True if the frame should be advanced based on user input -->
0N/A <!ATTLIST "GraphicControlExtension" "transparentColorFlag" (
0N/A "TRUE" | "FALSE") #REQUIRED>
0N/A <!-- True if a transparent color exists -->
0N/A <!ATTLIST "GraphicControlExtension" "delayTime" #CDATA #REQUIRED>
0N/A <!-- The time to delay between frames, in hundredths of a second -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "GraphicControlExtension" "transparentColorIndex"
0N/A #CDATA #REQUIRED>
0N/A <!-- The transparent color, if transparentColorFlag is true -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A <!ELEMENT "PlainTextExtension" EMPTY>
0N/A <!-- A plain text (text grid) extension -->
0N/A <!ATTLIST "PlainTextExtension" "textGridLeft" #CDATA #REQUIRED>
0N/A <!-- The X offset of the text grid -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "PlainTextExtension" "textGridTop" #CDATA #REQUIRED>
0N/A <!-- The Y offset of the text grid -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "PlainTextExtension" "textGridWidth" #CDATA #REQUIRED>
0N/A <!-- The number of columns in the text grid -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 1 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "PlainTextExtension" "textGridHeight" #CDATA #REQUIRED>
0N/A <!-- The number of rows in the text grid -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 1 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "PlainTextExtension" "characterCellWidth" #CDATA
0N/A <!-- The width of a character cell -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 1 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "PlainTextExtension" "characterCellHeight" #CDATA
0N/A <!-- The height of a character cell -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 1 (inclusive) -->
0N/A <!-- Max value: 65535 (inclusive) -->
0N/A <!ATTLIST "PlainTextExtension" "textForegroundColor" #CDATA
0N/A <!-- The text foreground color index -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A <!ATTLIST "PlainTextExtension" "textBackgroundColor" #CDATA
0N/A <!-- The text background color index -->
0N/A <!-- Data type: Integer -->
0N/A <!-- Min value: 0 (inclusive) -->
0N/A <!-- Max value: 255 (inclusive) -->
0N/A <!ELEMENT "ApplicationExtensions" (ApplicationExtension)*>
0N/A <!-- A set of application extensions -->
0N/A <!-- Min children: 1 -->
0N/A <!-- Max children: 2147483647 -->
0N/A <!ELEMENT "ApplicationExtension" EMPTY>
0N/A <!-- An application extension -->
0N/A <!-- User object: array of byte -->
0N/A <!-- Min length: 0 -->
0N/A <!-- Max length: 2147483647 -->
0N/A <!ATTLIST "ApplicationExtension" "applicationID" #CDATA
0N/A <!-- The application ID -->
0N/A <!-- Data type: String -->
0N/A <!ATTLIST "ApplicationExtension" "authenticationCode" #CDATA
0N/A <!-- The authentication code -->
0N/A <!-- Data type: String -->
0N/A <!ELEMENT "CommentExtensions" (CommentExtension)*>
0N/A <!-- A set of comments -->
0N/A <!-- Min children: 1 -->
0N/A <!-- Max children: 2147483647 -->
0N/A <!ELEMENT "CommentExtension" EMPTY>
0N/A <!-- A comment -->
0N/A <!ATTLIST "CommentExtension" "value" #CDATA #REQUIRED>
0N/A <!-- The comment -->
0N/A <!-- Data type: String -->
0N/A<
caption><
b>Mapping of Standard to GIF Native Stream Metadata</
b></
caption>
0N/A<
th>Standard Metadata Component</
th>
0N/A<
th>GIF Native Stream Metadata Component</
th>
0N/A<
td>/GlobalColorTable@backgroundColorIndex</
td>
0N/A<
td>/LogicalScreenDescriptor@colorResolution</
td>
0N/A<
td>/LogicalScreenDescriptor@pixelAspectRatio</
td>
0N/A<
td>/LogicalScreenDescriptor@logicalScreenWidth</
td>
0N/A<
td>/LogicalScreenDescriptor@logicalScreenHeight</
td>
0N/A<
td>/Version@value</
td>
0N/A<
caption><
b>Mapping of Standard to GIF Native Image Metadata</
b></
caption>
0N/A<
th>Standard Metadata Component</
th>
0N/A<
th>GIF Native Image Metadata Component</
th>
0N/A<
td>/ImageDescriptor@imageLeftPosition</
td>
0N/A<
td>/ImageDescriptor@imageTopPosition</
td>
0N/A<
td>/GraphicControlExtension@transparentColorIndex
0N/A(/GraphicControlExtension@transparentColorFlag is also set to