src/java.desktop/share/classes/javax/imageio/metadata/doc-files/gif_metadata.html
changeset 48264 efda6932a433
parent 47216 71c04702a3d5
child 49306 fe898e8bd271
equal deleted inserted replaced
47982:44371ff1ee9a 48264:efda6932a433
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
     1 <!doctype html>
     2 <html>
     2 <html lang="en">
     3 <head>
     3 <head>
       
     4   <meta charset="utf-8"/>
       
     5   <title>GIF Metadata Format Specification</title>
       
     6 </head>
     4 <!--
     7 <!--
     5 Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
     8 Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
     6 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     9 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7 
    10 
     8 This code is free software; you can redistribute it and/or modify it
    11 This code is free software; you can redistribute it and/or modify it
     9 under the terms of the GNU General Public License version 2 only, as
    12 under the terms of the GNU General Public License version 2 only, as
    10 published by the Free Software Foundation.  Oracle designates this
    13 published by the Free Software Foundation.  Oracle designates this
    24 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    27 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    25 or visit www.oracle.com if you need additional information or have any
    28 or visit www.oracle.com if you need additional information or have any
    26 questions.
    29 questions.
    27 -->
    30 -->
    28 
    31 
    29 <title>GIF Metadata Format Specification</title>
    32 <body>
    30 </head>
    33 
    31 
    34 <h1>GIF Metadata Format Specification</h1>
    32 <body bgcolor="white">
    35 <a id="gif_stream_metadata_format"></a>
    33 
    36 <h2>GIF Stream Metadata Format Specification</h2>
    34 <center><h1>
       
    35 GIF Metadata Format Specification
       
    36 </h1></center>
       
    37 <a name="gif_stream_metadata_format"></a>
       
    38 <center><h2>
       
    39 GIF Stream Metadata Format Specification
       
    40 </h2></center>
       
    41 
    37 
    42 <p>
    38 <p>
    43 
    39 
    44 The GIF stream metadata format encodes the information stored in the
    40 The GIF stream metadata format encodes the information stored in the
    45 per-file header, namely the file version, logical screen descriptor,
    41 per-file header, namely the file version, logical screen descriptor,
    57 images that do not have their own local color table.
    53 images that do not have their own local color table.
    58 
    54 
    59 <pre>
    55 <pre>
    60 &lt;!DOCTYPE "javax_imageio_gif_stream_1.0" [
    56 &lt;!DOCTYPE "javax_imageio_gif_stream_1.0" [
    61 
    57 
    62   &lt;!ELEMENT "javax_imageio_gif_stream_1.0" (Version?, 
    58   &lt;!ELEMENT "javax_imageio_gif_stream_1.0" (Version?,
    63     LogicalScreenDescriptor?, GlobalColorTable?)&gt;
    59     LogicalScreenDescriptor?, GlobalColorTable?)&gt;
    64 
    60 
    65     &lt;!ELEMENT "Version" EMPTY&gt;
    61     &lt;!ELEMENT "Version" EMPTY&gt;
    66       &lt;!-- The file version, either 87a or 89a --&gt;
    62       &lt;!-- The file version, either 87a or 89a --&gt;
    67       &lt;!ATTLIST "Version" "value" ("87a" | "89a") #REQUIRED&gt;
    63       &lt;!ATTLIST "Version" "value" ("87a" | "89a") #REQUIRED&gt;
    96 
    92 
    97     &lt;!ELEMENT "GlobalColorTable" (ColorTableEntry)*&gt;
    93     &lt;!ELEMENT "GlobalColorTable" (ColorTableEntry)*&gt;
    98       &lt;!-- The global color table --&gt;
    94       &lt;!-- The global color table --&gt;
    99       &lt;!-- Min children: 2 --&gt;
    95       &lt;!-- Min children: 2 --&gt;
   100       &lt;!-- Max children: 256 --&gt;
    96       &lt;!-- Max children: 256 --&gt;
   101       &lt;!ATTLIST "GlobalColorTable" "sizeOfGlobalColorTable" ("2" | 
    97       &lt;!ATTLIST "GlobalColorTable" "sizeOfGlobalColorTable" ("2" |
   102         "4" | "8" | "16" | "32" | "64" | "128" | "256") #REQUIRED&gt;
    98         "4" | "8" | "16" | "32" | "64" | "128" | "256") #REQUIRED&gt;
   103         &lt;!-- The number of entries in the global color table --&gt;
    99         &lt;!-- The number of entries in the global color table --&gt;
   104       &lt;!ATTLIST "GlobalColorTable" "backgroundColorIndex" #CDATA
   100       &lt;!ATTLIST "GlobalColorTable" "backgroundColorIndex" #CDATA
   105          #REQUIRED&gt;
   101          #REQUIRED&gt;
   106         &lt;!-- The index of the color table entry to be used as a background --&gt;
   102         &lt;!-- The index of the color table entry to be used as a background --&gt;
   133           &lt;!-- Data type: Integer --&gt;
   129           &lt;!-- Data type: Integer --&gt;
   134           &lt;!-- Min value: 0 (inclusive) --&gt;
   130           &lt;!-- Min value: 0 (inclusive) --&gt;
   135           &lt;!-- Max value: 255 (inclusive) --&gt;
   131           &lt;!-- Max value: 255 (inclusive) --&gt;
   136 ]&gt;
   132 ]&gt;
   137 </pre>
   133 </pre>
   138 <a name="gif_image_metadata_format"></a>
   134 <a id="gif_image_metadata_format"></a>
   139 <center><h2>
   135 <h2>GIF Image Metadata Format Specification</h2>
   140 GIF Image Metadata Format Specification
       
   141 </h2></center>
       
   142 <p>
   136 <p>
   143 
   137 
   144 The GIF image metadata format encodes the image descriptor, local
   138 The GIF image metadata format encodes the image descriptor, local
   145 color table, and extension information assciated with a single image
   139 color table, and extension information assciated with a single image
   146 within a GIF file, typically a frame of an animation.
   140 within a GIF file, typically a frame of an animation.
   178 advanced only on user input.
   172 advanced only on user input.
   179 
   173 
   180 <pre>
   174 <pre>
   181 &lt;!DOCTYPE "javax_imageio_gif_image_1.0" [
   175 &lt;!DOCTYPE "javax_imageio_gif_image_1.0" [
   182 
   176 
   183   &lt;!ELEMENT "javax_imageio_gif_image_1.0" (ImageDescriptor?, 
   177   &lt;!ELEMENT "javax_imageio_gif_image_1.0" (ImageDescriptor?,
   184     LocalColorTable?, GraphicControlExtension?, PlainTextExtension?, 
   178     LocalColorTable?, GraphicControlExtension?, PlainTextExtension?,
   185     ApplicationExtensions?, CommentExtensions?)&gt;
   179     ApplicationExtensions?, CommentExtensions?)&gt;
   186 
   180 
   187     &lt;!ELEMENT "ImageDescriptor" EMPTY&gt;
   181     &lt;!ELEMENT "ImageDescriptor" EMPTY&gt;
   188       &lt;!-- The image descriptor --&gt;
   182       &lt;!-- The image descriptor --&gt;
   189       &lt;!ATTLIST "ImageDescriptor" "imageLeftPosition" #CDATA #REQUIRED&gt;
   183       &lt;!ATTLIST "ImageDescriptor" "imageLeftPosition" #CDATA #REQUIRED&gt;
   212 
   206 
   213     &lt;!ELEMENT "LocalColorTable" (ColorTableEntry)*&gt;
   207     &lt;!ELEMENT "LocalColorTable" (ColorTableEntry)*&gt;
   214       &lt;!-- The local color table --&gt;
   208       &lt;!-- The local color table --&gt;
   215       &lt;!-- Min children: 2 --&gt;
   209       &lt;!-- Min children: 2 --&gt;
   216       &lt;!-- Max children: 256 --&gt;
   210       &lt;!-- Max children: 256 --&gt;
   217       &lt;!ATTLIST "LocalColorTable" "sizeOfLocalColorTable" ("2" | 
   211       &lt;!ATTLIST "LocalColorTable" "sizeOfLocalColorTable" ("2" |
   218         "4" | "8" | "16" | "32" | "64" | "128" | "256") #REQUIRED&gt;
   212         "4" | "8" | "16" | "32" | "64" | "128" | "256") #REQUIRED&gt;
   219         &lt;!-- The number of entries in the local color table --&gt;
   213         &lt;!-- The number of entries in the local color table --&gt;
   220       &lt;!ATTLIST "LocalColorTable" "sortFlag" ("TRUE" | "FALSE")
   214       &lt;!ATTLIST "LocalColorTable" "sortFlag" ("TRUE" | "FALSE")
   221          #REQUIRED&gt;
   215          #REQUIRED&gt;
   222         &lt;!-- True if the local color table is sorted by frequency --&gt;
   216         &lt;!-- True if the local color table is sorted by frequency --&gt;
   244           &lt;!-- Min value: 0 (inclusive) --&gt;
   238           &lt;!-- Min value: 0 (inclusive) --&gt;
   245           &lt;!-- Max value: 255 (inclusive) --&gt;
   239           &lt;!-- Max value: 255 (inclusive) --&gt;
   246 
   240 
   247     &lt;!ELEMENT "GraphicControlExtension" EMPTY&gt;
   241     &lt;!ELEMENT "GraphicControlExtension" EMPTY&gt;
   248       &lt;!-- A graphic control extension --&gt;
   242       &lt;!-- A graphic control extension --&gt;
   249       &lt;!ATTLIST "GraphicControlExtension" "disposalMethod" ("none" | 
   243       &lt;!ATTLIST "GraphicControlExtension" "disposalMethod" ("none" |
   250         "doNotDispose" | "restoreToBackgroundColor" | 
   244         "doNotDispose" | "restoreToBackgroundColor" |
   251         "restoreToPrevious" | "undefinedDisposalMethod4" | 
   245         "restoreToPrevious" | "undefinedDisposalMethod4" |
   252         "undefinedDisposalMethod5" | "undefinedDisposalMethod6" | 
   246         "undefinedDisposalMethod5" | "undefinedDisposalMethod6" |
   253         "undefinedDisposalMethod7") #REQUIRED&gt;
   247         "undefinedDisposalMethod7") #REQUIRED&gt;
   254         &lt;!-- The disposal method for this frame --&gt;
   248         &lt;!-- The disposal method for this frame --&gt;
   255       &lt;!ATTLIST "GraphicControlExtension" "userInputFlag" ("TRUE" | 
   249       &lt;!ATTLIST "GraphicControlExtension" "userInputFlag" ("TRUE" |
   256         "FALSE") #REQUIRED&gt;
   250         "FALSE") #REQUIRED&gt;
   257         &lt;!-- True if the frame should be advanced based on user input --&gt;
   251         &lt;!-- True if the frame should be advanced based on user input --&gt;
   258       &lt;!ATTLIST "GraphicControlExtension" "transparentColorFlag" (
   252       &lt;!ATTLIST "GraphicControlExtension" "transparentColorFlag" (
   259         "TRUE" | "FALSE") #REQUIRED&gt;
   253         "TRUE" | "FALSE") #REQUIRED&gt;
   260         &lt;!-- True if a transparent color exists --&gt;
   254         &lt;!-- True if a transparent color exists --&gt;
   348           &lt;!-- Data type: String --&gt;
   342           &lt;!-- Data type: String --&gt;
   349 ]&gt;
   343 ]&gt;
   350 </pre>
   344 </pre>
   351 
   345 
   352 <p>
   346 <p>
   353 <a name="mapping"></a>
   347 <a id="mapping"></a>
   354 <center>
       
   355 <table border=1>
   348 <table border=1>
   356 <caption><b>Mapping of Standard to GIF Native Stream Metadata</b></caption>
   349 <caption><b>Mapping of Standard to GIF Native Stream Metadata</b></caption>
   357 <tr>
   350 <tr>
   358 <th>Standard Metadata Component</th>
   351 <th>Standard Metadata Component</th>
   359 <th>GIF Native Stream Metadata Component</th>
   352 <th>GIF Native Stream Metadata Component</th>
   397 <tr>
   390 <tr>
   398 <td>/Document/FormatVersion@value</td>
   391 <td>/Document/FormatVersion@value</td>
   399 <td>/Version@value</td>
   392 <td>/Version@value</td>
   400 </tr>
   393 </tr>
   401 </table>
   394 </table>
   402 </center>
   395 
   403 
       
   404 <center>
       
   405 <table border=1>
   396 <table border=1>
   406 <caption><b>Mapping of Standard to GIF Native Image Metadata</b></caption>
   397 <caption><b>Mapping of Standard to GIF Native Image Metadata</b></caption>
   407 <tr>
   398 <tr>
   408 <th>Standard Metadata Component</th>
   399 <th>Standard Metadata Component</th>
   409 <th>GIF Native Image Metadata Component</th>
   400 <th>GIF Native Image Metadata Component</th>
   441 <td>/GraphicControlExtension@transparentColorIndex
   432 <td>/GraphicControlExtension@transparentColorIndex
   442 (/GraphicControlExtension@transparentColorFlag is also set to
   433 (/GraphicControlExtension@transparentColorFlag is also set to
   443 "TRUE")</td>
   434 "TRUE")</td>
   444 </tr>
   435 </tr>
   445 </table>
   436 </table>
   446 </center>
       
   447 
   437 
   448 </body>
   438 </body>
   449 </html>
   439 </html>