• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>gifbuild</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="gifbuild.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>gifbuild — dump GIF data in a textual format, or undump it to a GIF</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">gifbuild</code>  [-v] [-a] [-d] [-t <em class="replaceable"><code>translation-table</code></em>] [-h] [<em class="replaceable"><code>gif-file</code></em>]</p></div></div><div class="refsect1"><a id="idm23"></a><h2>Options</h2><p>A program to convert a series of editable text GIF icon specifications and
3named GIF files into a multi-image GIF, usable as a graphic resource file.
4It can also dump existing GIFs in this format.  When dumping a GIF,
5certain sanity checks are performed which may result in a warning
6emitted to standard error.</p><p>If no GIF file is given, gifbuild will try to read a text input
7from stdin.</p></div><div class="refsect1"><a id="idm27"></a><h2>Specification Syntax</h2><p>Here is a syntax summary in informal BNF.  The token `NL' represents a
8required newline.</p><pre class="programlisting">
9&lt;gif-spec&gt; ::= &lt;header-block&gt; &lt;image-block&gt;...
10
11&lt;header-block&gt; ::= &lt;header-declaration&gt;...
12
13&lt;header-declaration ::=
14		| screen width &lt;digits&gt; NL
15		| screen height &lt;digits&gt; NL
16		| screen colors &lt;digits&gt; NL
17		| screen background &lt;digits&gt; NL
18		| pixel aspect byte &lt;digits&gt; NL
19		| screen map &lt;color-table&gt; NL
20
21&lt;color-table&gt; ::= &lt;color-declaration&gt;... end NL
22
23&lt;color-declaration&gt; ::= rgb &lt;digits&gt; &lt;digits&gt; &lt;digits&gt; [ is &lt;key&gt;] NL
24                | sort flag {on|off} NL
25
26&lt;image-block&gt; ::= include &lt;file-name&gt; NL
27		| image NL
28			&lt;image-declaration&gt;...
29			&lt;raster-picture&gt;
30			[ &lt;extension&gt; ]
31
32&lt;image-declarations&gt; ::= image top &lt;digits&gt; NL
33			| image left &lt;digits&gt; NL
34			| image interlaced NL
35			| image map &lt;color-table&gt; NL
36			| image bits &lt;digits&gt; by &lt;digits&gt; [hex|ascii] NL &lt;raster-block&gt;
37
38&lt;extension&gt; := &lt;comment&gt; NL &lt;extension-block&gt; NL end NL
39		| &lt;plaintext&gt; NL &lt;extension-block&gt; NL end NL
40                | graphics control NL &lt;GCB-part&gt; NL end NL
41                | netscape loop  &lt;digits&gt; NL
42		| extension &lt;hex-digits&gt; NL &lt;extension-block&gt; NL end NL
43
44&lt;GCB-part&gt; ::= disposal mode &lt;digits&gt; NL
45                | user input flag {on|off} NL
46                | delay &lt;digits&gt; NL
47                | transparent index &lt;digits&gt; NL
48
49</pre><p>If the data types of the <span class="quote">“<span class="quote">screen height</span>”</span>,
50<span class="quote">“<span class="quote">screen width</span>”</span>, <span class="quote">“<span class="quote">screen background</span>”</span>,
51<span class="quote">“<span class="quote">image top</span>”</span>, and <span class="quote">“<span class="quote">image left</span>”</span> declarations
52aren't obvious to you, what are you doing with this software?</p><p>The <span class="quote">“<span class="quote">pixel aspect byte</span>”</span> declaration sets an integer
53denominator for a fraction expressing the puxel aspect ratio.  See the
54GIF standard for details; this field is actually long obsolete.</p><p>A color table declares color indices (in ascending order from 0)
55and may associate them with key characters (these associations are
56absent when the map is more than 94 colors lang and raster blocks
57using it must use hex pairs).  These characters can later be used in
58raster blocks.  As these must be printable and non-whitespace, you can
59only specify 94 colors per icon.  Life is like that sometimes.</p><p>A color table declaration can also set the table's sort flag with
60"sort flag on" or "sort flag off" on any line before the end.</p><p>An <span class="quote">“<span class="quote">ascii</span>”</span> raster block is just a block of key
61characters (used for a color map of 94 or fewer colors).  A
62<span class="quote">“<span class="quote">hex</span>”</span> raster block uses hex digit pairs instead (used for
63a color map with more than 94 colors). The default is ASCII.  It
64should be sized correctly for the <span class="quote">“<span class="quote">image bits</span>”</span>
65declaration that leads it. Raster blocks from interlaced GIFs are
66dumped with the lines in non-interlaced order.</p><p>The <span class="quote">“<span class="quote">comment</span>”</span>, <span class="quote">“<span class="quote">plaintext</span>”</span> or
67<span class="quote">“<span class="quote">ggraphics control</span>”</span> keywords lead defined GIF89 extension
68record data. The final GIF89 type, graphics control and application
69block, are not yet supported, but the code does recognize a Netscape
70loop block.  You can also say <span class="quote">“<span class="quote">extension</span>”</span> followed by a
71hexadecimal record type.  All of these extension declarations must be
72followed by an extension block, which is terminated by the keyword
73<span class="quote">“<span class="quote">end</span>”</span> on its own line.</p><p>An extension block is a series of text lines, each interpreted
74as a string of bytes to fill an extension block (the terminating
75newline is stripped).  Text may include standard C-style octal and hex
76escapes preceded by a backslash.</p><p>A graphics control block declaration creates a graphics control
77extension block; for the field semantics see the GIF89 standard, part
7823.</p><p>A netscape loop declaration creates an application extension
79block containing a NETSCAPE 2.0 animation loop control with a
80specified repeat count (repeat count 0 means loop forever). This must
81be immediately after the header declaration. These loop blocks are
82interpreted by the Netscape/Mozilla/Firefox line of browsers.</p><p>All &lt;digits&gt; tokens are interpreted as decimal numerals;
83&lt;hex-digits&gt; tokens are interpreted as two hex digits (a byte). All
84coordinates are zero-origin with the top left corner (0,0).  Range
85checking is weak and signedness checking nonexistent; caveat
86hacker!</p><p>In general, the amount of whitespace and order of declarations within a
87header or image block is not significant, except that a raster picture
88must immediately follow its <span class="quote">“<span class="quote">image bits</span>”</span> bits declaration.</p><p>The <span class="quote">“<span class="quote">include</span>”</span> declaration includes a named GIF as
89the next image.  The global color maps of included GIFs are merged
90with the base table defined by any <span class="quote">“<span class="quote">screen color</span>”</span>
91declaration.  All images of an included multi-image GIF will be
92included in order.</p><p>Comments (preceded with <span class="quote">“<span class="quote">#</span>”</span>) will be ignored.</p></div><div class="refsect1"><a id="idm62"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><p>Verbose mode (show progress).
93Enables printout of running scan lines.</p></dd><dt><span class="term">-d</span></dt><dd><p> Dump the input GIF file(s) into the text form described
94above.</p></dd><dt><span class="term">-t</span></dt><dd><p>Specify name characters to use when dumping raster blocks.  Only
95valid with -d option.</p></dd><dt><span class="term">-h</span></dt><dd><p>Print one line of command line help, similar to Usage
96above.</p></dd></dl></div></div><div class="refsect1"><a id="idm81"></a><h2>Bugs</h2><p>Error checking is rudimentary.</p></div><div class="refsect1"><a id="idm84"></a><h2>Example:</h2><p>A sample icon file called <code class="filename">sample.ico</code> is
97included in the pic directory of the GIFLIB source
98distribution.</p></div><div class="refsect1"><a id="idm88"></a><h2>Author</h2><p>Eric S. Raymond <code class="email">&lt;<a class="email" href="mailto:esr@thyrsus.com">esr@thyrsus.com</a>&gt;</code></p></div></div></body></html>