| 1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
| 2 |
<!DOCTYPE refentry PUBLIC |
| 3 |
"-//OASIS//DTD DocBook XML V4.1.2//EN" |
| 4 |
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ |
| 5 |
<!ENTITY email "[email protected]"> |
| 6 |
]> |
| 7 |
<refentry id='gifbuild.1'> |
| 8 |
<refentryinfo><date>2 May 2012</date></refentryinfo> |
| 9 |
<refmeta> |
| 10 |
<refentrytitle>gifbuild</refentrytitle> |
| 11 |
<manvolnum>1</manvolnum> |
| 12 |
<refmiscinfo class="source">GIFLIB</refmiscinfo> |
| 13 |
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo> |
| 14 |
</refmeta> |
| 15 |
<refnamediv id='name'> |
| 16 |
<refname>gifbuild</refname> |
| 17 |
<refpurpose>dump GIF data in a textual format, or undump it to a GIF</refpurpose> |
| 18 |
</refnamediv> |
| 19 |
|
| 20 |
<refsynopsisdiv id='synopsis'> |
| 21 |
|
| 22 |
<cmdsynopsis> |
| 23 |
<command>gifbuild</command> |
| 24 |
<arg choice='opt'>-v</arg> |
| 25 |
<arg choice='opt'>-a</arg> |
| 26 |
<arg choice='opt'>-d</arg> |
| 27 |
<arg choice='opt'>-t <replaceable>translation-table</replaceable></arg> |
| 28 |
<arg choice='opt'>-h</arg> |
| 29 |
<arg choice='opt'><replaceable>gif-file</replaceable></arg> |
| 30 |
</cmdsynopsis> |
| 31 |
</refsynopsisdiv> |
| 32 |
|
| 33 |
<refsect1><title>Options</title> |
| 34 |
|
| 35 |
<para>A program to convert a series of editable text GIF icon specifications and |
| 36 |
named GIF files into a multi-image GIF, usable as a graphic resource file. |
| 37 |
It can also dump existing GIFs in this format. Both directions are |
| 38 |
lossless and mutually inverse.</para> |
| 39 |
|
| 40 |
<para>When dumping a GIF, certain sanity checks are performed which |
| 41 |
may result in a warning emitted to standard error.</para> |
| 42 |
|
| 43 |
<para>If no GIF file is given, gifbuild will try to read a text input |
| 44 |
from stdin.</para> |
| 45 |
|
| 46 |
</refsect1> |
| 47 |
<refsect1><title>Specification Syntax</title> |
| 48 |
|
| 49 |
<para>Here is a syntax summary in informal BNF. The token `NL' represents a |
| 50 |
required newline.</para> |
| 51 |
|
| 52 |
<programlisting> |
| 53 |
<gif-spec> ::= <header-block> <image-block>... |
| 54 |
|
| 55 |
<header-block> ::= <header-declaration>... |
| 56 |
|
| 57 |
<header-declaration ::= |
| 58 |
| screen width <digits> NL |
| 59 |
| screen height <digits> NL |
| 60 |
| screen colors <digits> NL |
| 61 |
| screen background <digits> NL |
| 62 |
| pixel aspect byte <digits> NL |
| 63 |
| screen map <color-table> NL |
| 64 |
|
| 65 |
<color-table> ::= <color-declaration>... end NL |
| 66 |
|
| 67 |
<color-declaration> ::= rgb <digits> <digits> <digits> [ is <key>] NL |
| 68 |
| sort flag {on|off} NL |
| 69 |
|
| 70 |
<image-block> ::= include <file-name> NL |
| 71 |
| image NL |
| 72 |
<image-declaration>... |
| 73 |
<raster-picture> |
| 74 |
[ <extension> ] |
| 75 |
|
| 76 |
<image-declarations> ::= image top <digits> NL |
| 77 |
| image left <digits> NL |
| 78 |
| image interlaced NL |
| 79 |
| image map <color-table> NL |
| 80 |
| image bits <digits> by <digits> [hex|ascii] NL <raster-block> |
| 81 |
|
| 82 |
<extension> := <comment> NL <extension-block> NL end NL |
| 83 |
| <plaintext> NL <extension-block> NL end NL |
| 84 |
| graphics control NL <GCB-part> NL end NL |
| 85 |
| netscape loop <digits> NL |
| 86 |
| extension <hex-digits> NL <extension-block> NL end NL |
| 87 |
|
| 88 |
<GCB-part> ::= disposal mode <digits> NL |
| 89 |
| user input flag {on|off} NL |
| 90 |
| delay <digits> NL |
| 91 |
| transparent index <digits> NL |
| 92 |
|
| 93 |
</programlisting> |
| 94 |
|
| 95 |
<para>If the data types of the <quote>screen height</quote>, |
| 96 |
<quote>screen width</quote>, <quote>screen background</quote>, |
| 97 |
<quote>image top</quote>, and <quote>image left</quote> declarations |
| 98 |
aren't obvious to you, what are you doing with this software?</para> |
| 99 |
|
| 100 |
<para>The <quote>pixel aspect byte</quote> declaration sets an integer |
| 101 |
denominator for a fraction expressing the pixel aspect ratio. See the |
| 102 |
GIF standard for details; this field is actually long obsolete.</para> |
| 103 |
|
| 104 |
<para>A color table declares color indices (in ascending order from 0) |
| 105 |
and may associate them with key characters (these associations are |
| 106 |
absent when the map is more than 94 colors lang and raster blocks |
| 107 |
using it must use hex pairs). These characters can later be used in |
| 108 |
raster blocks. As these must be printable and non-whitespace, you can |
| 109 |
only specify 94 colors per icon. Life is like that sometimes.</para> |
| 110 |
|
| 111 |
<para>A color table declaration can also set the table's sort flag with |
| 112 |
"sort flag on" or "sort flag off" on any line before the end.</para> |
| 113 |
|
| 114 |
<para>An <quote>ascii</quote> raster block is just a block of key |
| 115 |
characters (used for a color map of 94 or fewer colors). A |
| 116 |
<quote>hex</quote> raster block uses hex digit pairs instead (used for |
| 117 |
a color map with more than 94 colors). The default is ASCII. It |
| 118 |
should be sized correctly for the <quote>image bits</quote> |
| 119 |
declaration that leads it. Raster blocks from interlaced GIFs are |
| 120 |
dumped with the lines in non-interlaced order.</para> |
| 121 |
|
| 122 |
<para>The <quote>comment</quote>, <quote>plaintext</quote> or |
| 123 |
<quote>graphics control</quote> keywords lead defined GIF89 extension |
| 124 |
record data. The final GIF89 type, graphics control and application |
| 125 |
block, are not yet supported, but the code does recognize a Netscape |
| 126 |
loop block. You can also say <quote>extension</quote> followed by a |
| 127 |
hexadecimal record type. All of these extension declarations must be |
| 128 |
followed by an extension block, which is terminated by the keyword |
| 129 |
<quote>end</quote> on its own line.</para> |
| 130 |
|
| 131 |
<para>An extension block is a series of text lines, each interpreted |
| 132 |
as a string of bytes to fill an extension block (the terminating |
| 133 |
newline is stripped). Text may include standard C-style octal and hex |
| 134 |
escapes preceded by a backslash.</para> |
| 135 |
|
| 136 |
<para>A graphics control block declaration creates a graphics control |
| 137 |
extension block; for the field semantics see the GIF89 standard, part |
| 138 |
23.</para> |
| 139 |
|
| 140 |
<para>A netscape loop declaration creates an application extension |
| 141 |
block containing a NETSCAPE 2.0 animation loop control with a |
| 142 |
specified repeat count (repeat count 0 means loop forever). This must |
| 143 |
be immediately after the header declaration. These loop blocks are |
| 144 |
interpreted by the Netscape/Mozilla/Firefox line of browsers.</para> |
| 145 |
|
| 146 |
<para>All <digits> tokens are interpreted as decimal numerals; |
| 147 |
<hex-digits> tokens are interpreted as two hex digits (a byte). All |
| 148 |
coordinates are zero-origin with the top left corner (0,0). Range |
| 149 |
checking is weak and signedness checking nonexistent; caveat |
| 150 |
hacker!</para> |
| 151 |
|
| 152 |
<para>In general, the amount of whitespace and order of declarations within a |
| 153 |
header or image block is not significant, except that a raster picture |
| 154 |
must immediately follow its <quote>image bits</quote> bits declaration.</para> |
| 155 |
|
| 156 |
<para>The <quote>include</quote> declaration includes a named GIF as |
| 157 |
the next image. The global color maps of included GIFs are merged |
| 158 |
with the base table defined by any <quote>screen color</quote> |
| 159 |
declaration. All images of an included multi-image GIF will be |
| 160 |
included in order.</para> |
| 161 |
|
| 162 |
<para>Comments (preceded with <quote>#</quote>) will be ignored.</para> |
| 163 |
|
| 164 |
</refsect1> |
| 165 |
<refsect1><title>Options</title> |
| 166 |
|
| 167 |
<variablelist> |
| 168 |
<varlistentry> |
| 169 |
<term>-v</term> |
| 170 |
<listitem> |
| 171 |
<para>Verbose mode (show progress). |
| 172 |
Enables printout of running scan lines.</para> |
| 173 |
</listitem> |
| 174 |
</varlistentry> |
| 175 |
|
| 176 |
<varlistentry> |
| 177 |
<term>-d</term> |
| 178 |
<listitem> |
| 179 |
<para> Dump the input GIF file(s) into the text form described |
| 180 |
above.</para> |
| 181 |
</listitem> |
| 182 |
</varlistentry> |
| 183 |
|
| 184 |
<varlistentry> |
| 185 |
<term>-t</term> |
| 186 |
<listitem> |
| 187 |
<para>Specify name characters to use when dumping raster blocks. Only |
| 188 |
valid with -d option.</para> |
| 189 |
</listitem> |
| 190 |
</varlistentry> |
| 191 |
|
| 192 |
<varlistentry> |
| 193 |
<term>-h</term> |
| 194 |
<listitem> |
| 195 |
<para>Print one line of command line help, similar to Usage |
| 196 |
above.</para> |
| 197 |
</listitem> |
| 198 |
</varlistentry> |
| 199 |
</variablelist> |
| 200 |
|
| 201 |
</refsect1> |
| 202 |
<refsect1><title>Bugs</title> |
| 203 |
|
| 204 |
<para>Error checking is rudimentary.</para> |
| 205 |
|
| 206 |
</refsect1> |
| 207 |
<refsect1><title>Example:</title> |
| 208 |
|
| 209 |
<para>A sample icon file called <filename>sample.ico</filename> is |
| 210 |
included in the pic directory of the GIFLIB source |
| 211 |
distribution.</para> |
| 212 |
|
| 213 |
</refsect1> |
| 214 |
<refsect1><title>Author</title> |
| 215 |
|
| 216 |
<para>Eric S. Raymond <email>&email;</email></para> |
| 217 |
|
| 218 |
</refsect1> |
| 219 |
</refentry> |