update openharmony 1.0.1
@@ -0,0 +1,58 @@
|
||||
# Copyright (c) Huawei Technologies Co., Ltd. 2019-2019. All rights reserved.
|
||||
|
||||
if (defined(ohos_lite)) { # is on lite Os for ipcamera
|
||||
import("//build/lite/config/component/lite_component.gni")
|
||||
|
||||
config("libgif_config") {
|
||||
include_dirs = [ "//third_party/giflib" ]
|
||||
}
|
||||
|
||||
libgif_source = [
|
||||
"//third_party/giflib/dgif_lib.c",
|
||||
"//third_party/giflib/egif_lib.c",
|
||||
"//third_party/giflib/gifalloc.c",
|
||||
"//third_party/giflib/gif_err.c",
|
||||
"//third_party/giflib/gif_font.c",
|
||||
"//third_party/giflib/gif_hash.c",
|
||||
"//third_party/giflib/openbsd-reallocarray.c",
|
||||
]
|
||||
|
||||
lite_library("libgif") {
|
||||
target_type = "shared_library"
|
||||
sources = libgif_source
|
||||
|
||||
public_configs = [ ":libgif_config" ]
|
||||
}
|
||||
} else {
|
||||
import("//build/ohos.gni")
|
||||
|
||||
config("build_private_config") {
|
||||
cflags = [
|
||||
"-Werror",
|
||||
"-Wno-format",
|
||||
"-Wno-sign-compare",
|
||||
"-Wno-unused-parameter",
|
||||
"-DHAVE_CONFIG_H",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_source_set("gif_static") {
|
||||
sources = [
|
||||
"//third_party/giflib/dgif_lib.c",
|
||||
"//third_party/giflib/egif_lib.c",
|
||||
"//third_party/giflib/gif_err.c",
|
||||
"//third_party/giflib/gif_font.c",
|
||||
"//third_party/giflib/gif_hash.c",
|
||||
"//third_party/giflib/gifalloc.c",
|
||||
"//third_party/giflib/openbsd-reallocarray.c",
|
||||
"//third_party/giflib/quantize.c",
|
||||
]
|
||||
include_dirs = [ "//third_party/giflib" ]
|
||||
configs = [ ":build_private_config" ]
|
||||
}
|
||||
|
||||
ohos_shared_library("libgif") {
|
||||
deps = [ ":gif_static" ]
|
||||
subsystem_name = "common"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,665 @@
|
||||
shipper: ignore this.
|
||||
It's retained for archival purposes only. The single point of
|
||||
truth about changes and the reasons for them is the repository.
|
||||
|
||||
2007-11-10 14:50 abadger1999
|
||||
|
||||
* NEWS, configure.ac, lib/Makefile.am, lib/egif_lib.c,
|
||||
lib/gif_hash.c: 4.1.6 update. Errors in including headers could
|
||||
lead to build problems on some platforms.
|
||||
|
||||
2007-11-10 13:16 abadger1999
|
||||
|
||||
* configure.ac: Bump release version in configure.ac.
|
||||
|
||||
2007-11-10 13:15 abadger1999
|
||||
|
||||
* Makefile.am: Remove PATENT_PROBLEMS from build rules as well.
|
||||
|
||||
2007-11-10 13:09 abadger1999
|
||||
|
||||
* NEWS, PATENT_PROBLEMS, lib/Makefile.am: Remove PATENT_PROBLEMS as
|
||||
it's no longer covered. Update NEWS and Makefile.am for the new
|
||||
release.
|
||||
|
||||
2007-11-10 10:46 abadger1999
|
||||
|
||||
* configure.ac, util/gif2epsn.c, util/gif2iris.c, util/gif2ps.c,
|
||||
util/gif2rgb.c, util/gif2rle.c, util/gif2x11.c: Find and fix
|
||||
segfaults in the gif2* programs due to referencing the ColorMap
|
||||
beforefinding out if hte GifFile produced a valid colormap or was
|
||||
corrupt.
|
||||
|
||||
2007-11-10 09:30 abadger1999
|
||||
|
||||
* lib/dgif_lib.c: Add checks to fail gracefully when corrupted
|
||||
images are submitted that have improper LZ codes.
|
||||
|
||||
2007-11-10 09:22 abadger1999
|
||||
|
||||
* lib/: dgif_lib.c, egif_lib.c: Further checks to compile correctly
|
||||
on WIN32.
|
||||
|
||||
2007-11-09 20:28 abadger1999
|
||||
|
||||
* util/giftext.c: Fix a SegFault when a GifFile does not store a
|
||||
global colormap.
|
||||
|
||||
2007-11-09 20:13 abadger1999
|
||||
|
||||
* util/gif2x11.c: Fix gif2x11 to work with modern, 24 bit displays.
|
||||
|
||||
2007-11-09 14:18 abadger1999
|
||||
|
||||
* configure.ac: Check for headers as well as the libraries for rle,
|
||||
X11, and gl_s.
|
||||
|
||||
2007-11-09 13:24 abadger1999
|
||||
|
||||
* configure.ac: Merge better fix for finding an unsignd 32 bit
|
||||
integer type.
|
||||
|
||||
2007-11-09 13:01 abadger1999
|
||||
|
||||
* configure.ac: Add configure comman line switches to turn off X11,
|
||||
rle, and gl support.
|
||||
|
||||
2007-11-09 12:36 abadger1999
|
||||
|
||||
* configure.ac, util/Makefile.am: Fixes to build under cygwin.
|
||||
|
||||
2007-11-09 11:49 abadger1999
|
||||
|
||||
* configure.ac: Make GCC check more robust. Add a needed automake
|
||||
check.
|
||||
|
||||
2007-11-09 11:48 abadger1999
|
||||
|
||||
* lib/dgif_lib.c: Fix closing file handles on failure in
|
||||
DGifOpenFileHandle().
|
||||
|
||||
2007-11-09 11:33 abadger1999
|
||||
|
||||
* lib/egif_lib.c: Save files in binary mode for WIN32 as well as
|
||||
MSDOS.
|
||||
|
||||
2007-11-09 11:25 abadger1999
|
||||
|
||||
* lib/Makefile.ms: * Makefile for building under Visual C++ from
|
||||
Bug #981209.
|
||||
|
||||
2005-11-13 20:14 abadger1999
|
||||
|
||||
* configure.ac, lib/Makefile.am, util/Makefile.am: Changes to
|
||||
conditionalize -Wall upon compiling with gcc.
|
||||
|
||||
2005-11-06 08:45 abadger1999
|
||||
|
||||
* lib/: gif_hash.c, gif_hash.h: Add inttypes.h to the headers we
|
||||
could include to get a 32-it int type.
|
||||
|
||||
2005-11-06 08:34 abadger1999
|
||||
|
||||
* configure.ac: Search for ISO/ANSI definitions of uint32_t in
|
||||
stdint.h _and_ inttypes.h before POSIX u_int32_t in sys/types.h
|
||||
as some systems have sys/types.h without the definition.
|
||||
Eventually we need to code a test that the expected UINT32
|
||||
definition exists in the header we select so order does not
|
||||
matter.
|
||||
|
||||
2005-11-06 08:32 abadger1999
|
||||
|
||||
* AUTHORS, README: Modify so that it no longer appears that esr
|
||||
still maintains this package.
|
||||
|
||||
= giflib-4.1.4 =
|
||||
|
||||
2005-10-09 Toshio Kuratomi <toshio@tiki-lounge.com> - r94
|
||||
* Sync with libungif r93.
|
||||
* ChangeLog: Update to r92.
|
||||
* NEWS: Update with combined libungif/giflib changes.
|
||||
|
||||
2005-10-09 Toshio Kuratomi <toshio@tiki-lounge.com> - r92
|
||||
* lib/gif_lib.h: Change GifPrefixType to unsigned.
|
||||
|
||||
2005-10-09 Toshio Kuratomi <toshio@tiki-lounge.com> - r91
|
||||
* ChangeLog: Update to r90.
|
||||
* NEWS: Update on GBA and Windows fixes.
|
||||
|
||||
2005-10-06 Toshio Kuratomi <toshio@tiki-lounge.com> - r90
|
||||
Changes from Lennie Araki:
|
||||
* gba/giftest.mak: Prefix the names of defines for the GBA build with _GBA.
|
||||
* lib/dgif_lib.c, lib/gif_lib_private.h, lib/gif_err.c:
|
||||
- When Compiling for Game Boy Advance, file functions are not needed so
|
||||
exclude DGifOpenFileName(), DGifOpenFileHandle(), DGifSlurp(), and
|
||||
PrintGifError().
|
||||
- On Game Boy Advance we need to reduce memory usage. Change values to
|
||||
short int where appropriate.
|
||||
* lib/gif_lib.h:
|
||||
- Handle te GBA changes by defining GifPrefixType and GifWord to int
|
||||
unless compiling on GBA. Then use unsigned short and short
|
||||
respectively.
|
||||
- Fix a problem with the API on _WIN32. DrawText conflicts with the
|
||||
Windows API. Call it DrawGifText instead.
|
||||
|
||||
2005-09-27 Toshio Kuratomi <toshio@tiki-lounge.com> - r86
|
||||
* Sync with libungif r85.
|
||||
|
||||
2005-09-27 Toshio Kuratomi <toshio@tiki-lounge.com> - r82
|
||||
* AUTHORS: Add Daniel Eisenbud. Obscure email addresses.
|
||||
* libungif.spec: Bump to version 4.1.4.
|
||||
* configure.ac: Bump to 4.1.4. No longer check for ranlib.
|
||||
* doc/lzgif.txt: Change dos line encoding to UNIX.
|
||||
* lib/dgif_lib.c: (eisenbud)
|
||||
- Set GifFile's ColorMaps to NULL when we free a colormap object.
|
||||
- Detect some cases of corrupted GIFs which were crashing the library.
|
||||
* lib/egif_lib.c: Set ColorMaps to NULL when we free a colormap object.
|
||||
* lib/gifalloc.c: Set ColorMaps to NULL when we free a colormap object.
|
||||
* lib/dev2gif.c: Fix redefinition problem on IRIX.
|
||||
* NEWS: Update to 4.1.4
|
||||
* util/gifcomb.c: Set a olorMap to NULL.
|
||||
|
||||
2004-07-11 Toshio Kuratomi <toshio@tiki-lounge.com> - r79
|
||||
* gif2iris.c: Fixes from Georg Schwarz <geos[AT]epost.de>.
|
||||
- stdlib.h is available and needs to be included on IRIX.
|
||||
- ColorMapSize was being set from non-existent variables.
|
||||
|
||||
2004-05-29 Toshio Kuratomi <toshio@tiki-lounge.com> - r76
|
||||
* Sync with libungif-4.1.3.
|
||||
|
||||
2004-05-29 Toshio Kuratomi <toshio@tiki-lounge.com> - r74
|
||||
* ChangeLog, prop=lastlog: Sync with the subversion logs.
|
||||
|
||||
2004-05-29 Toshio Kuratomi <toshio@tiki-lounge.com> - r73
|
||||
* test-unx: Add a test of extension code.
|
||||
* lib/egif_lib.c: Remove a debugging statement
|
||||
|
||||
2004-05-29 Toshio Kuratomi <toshio@tiki-lounge.com> - r72
|
||||
* Makefile.am, doc/Makefile.am, pic/Makefile.am: Change wildcarded entries
|
||||
into explicit filenames so make distcheck will succeed.
|
||||
|
||||
2004-05-29 Toshio Kuratomi <toshio@tiki-lounge.com> - r71
|
||||
* ChangeLog, prop=lastlog: Sync the ChangeLog for the release.
|
||||
|
||||
2004-05-29 Toshio Kuratomi <toshio@tiki-lounge.com> - r70
|
||||
* AUTHORS: Add Lennie Araki to the list of contributers.
|
||||
* windows: The windows subdirectory and all files under it are contributions
|
||||
from Lennie Araki to provide a nice interface on MS Windows.
|
||||
* README: Redundancy fix.
|
||||
* doc/gif_lib.html: Add EGifPutExtension{First,Next,Last} to the documentation
|
||||
so people know they should use it instead of EGifPutExtension.
|
||||
* Makefile.am: Mark the windows files to be distributed.
|
||||
* NEWS: Complete the NEWS item for 4.1.3.
|
||||
|
||||
2004-05-29 Toshio Kuratomi <toshio@tiki-lounge.com> - r69
|
||||
* libungif.spec: Some updates from the latest RedHat spec.
|
||||
* configure.ac: Bump version to 4.1.3.
|
||||
* lib/gifalloc.c: Add to my comments on ESR's note about Extension blocks.
|
||||
* lib/egif_lib.c:
|
||||
- EGifPutComment(): reimplemented using EGifPutExtensionFirst, Next, and
|
||||
Last so that it won't break on unusually long comments.
|
||||
- EGifPutExtension{First,Next,Last}: Changed fwrites to WRITE so any
|
||||
user defined write function will get called properly.
|
||||
- EGifPutExtensionTerminate: if the Extension block is empty (Zero length)
|
||||
then don't attempt to output a last extension block, just output the
|
||||
block terminator.
|
||||
- EGifPutExtension: Comment that this function does not work when there
|
||||
are multiple subblocks in an Extension block. Use the functions
|
||||
EGifPutExtension{First,Next,Last} instead.
|
||||
- EGifSpew: Reimplement to use EGifPutExtension{First,Next,Last} so we
|
||||
don't output broken GIFs when there are multiple sub-blocks on an
|
||||
extension.
|
||||
* lib/Makefile.am: Bump version to 4.1.3.
|
||||
* NEWS: Begin writing an entry for 4.1.3.
|
||||
* util/icon2gif.c: Few casting fixes to make gcc -Wall happy.
|
||||
* util/gif2ps.c: printf format string corrections.
|
||||
|
||||
2004-05-26 Toshio Kuratomi <toshio@tiki-lounge.com> - r67
|
||||
* Clean up some typos.
|
||||
|
||||
2004-05-25 Toshio Kuratomi <toshio@tiki-lounge.com> - r66
|
||||
* Sync with libungif-4.1.2.
|
||||
|
||||
2004-03-03 Toshio Kuratomi <toshio@tiki-lounge.com> - r64
|
||||
Last minute updates to the release notes in various files.
|
||||
|
||||
2004-03-03 Toshio Kuratomi <toshio@tiki-lounge.com> - r63
|
||||
* Set property lastlog to remind me when I last synced the ChangeLog
|
||||
|
||||
2004-03-03 Toshio Kuratomi <toshio@tiki-lounge.com> - r62
|
||||
* ChangeLog: Update
|
||||
|
||||
2004-03-03 Toshio Kuratomi <toshio@tiki-lounge.com> - r61
|
||||
* configure.ac: Bump version to 4.1.2
|
||||
|
||||
2004-02-22 Toshio Kuratomi <toshio@tiki-lounge.com> - r59
|
||||
* configure.ac, lib/Makefile.am: Bump version. Forgot to do this for 4.1.1...
|
||||
|
||||
2004-02-22 Toshio Kuratomi <toshio@tiki-lounge.com> - r58
|
||||
* TODO: Take out -Wall as that's all ready now.
|
||||
|
||||
2004-02-22 Toshio Kuratomi <toshio@tiki-lounge.com> - r57
|
||||
Merge changes to the code from branch indent-audit r55
|
||||
* README: MakeExtension deprecation note.
|
||||
* TODO: Bunch of things I need to fix or check that I saw while doing the
|
||||
indentation of the code.
|
||||
* lib/getarg.h: indent changes
|
||||
* lib/dgif_lib.c: indent changes
|
||||
- Move stdlib.h out of #ifdef's as it's included on all platforms.
|
||||
- Add checks to be sure malloc and MakeMapObject succeed.
|
||||
* lib/quantize.c: indent changes
|
||||
- Move stdlib.h out of #ifdef's as it's included on all platforms.
|
||||
- _GifError already pulled in through gif_lib_private.h. Remove decl.
|
||||
- Make Count in NewColorMapType be unsigned.
|
||||
- Separated mallocs from conditionals in a few places. Easier reading.
|
||||
* lib/gifalloc.c: indent changes
|
||||
- Added four FIXME's where I think the code might not be doing what we
|
||||
want. Need to do more research to figure out.
|
||||
- Add note to MakeExtension that I think it needs to be deprecated.
|
||||
- Separated mallocs from conditionals in a few places. Easier reading.
|
||||
- FreeLastSavedImage: New private function to free the last image in a
|
||||
GifFile structure. Used to back out when unable to completely
|
||||
allocate a new SavedImage structure.
|
||||
- check for NULL values before deallocating in Free* functions and make
|
||||
sure all Free* functions set the pointer to NULL after they deallocate
|
||||
the memory.
|
||||
* lib/egif_lib.c: indent changes
|
||||
- EGifPutScreenDesc: If we have no colormap, output a default value for
|
||||
its size instead of trying to reference its unallocated BitsPerPixel
|
||||
field. (Fixes bug noted in r46)
|
||||
* lib/gif_lib.h: indent changes
|
||||
- Condense the #else #if VARARGS to #elif VARARGS check.
|
||||
* lib/qprintf.c: indent changes
|
||||
- Condense the #else #if VARARGS to #elif VARARGS check.
|
||||
* lib/dev2gif.c: indent changes
|
||||
* lib/getarg.c: indent changes
|
||||
* lib/gif_lib_private.h: indent changes
|
||||
* lib/gif_font.c: indent changes
|
||||
* lib/gif_err.c: indent changes
|
||||
|
||||
2004-02-22 Toshio Kuratomi <toshio@tiki-lounge.com> - r56
|
||||
* lib/Makefile.am, util/Makefile.am: Add -Wall to the compilation flags so
|
||||
we can keep the code from acquiring too much bad style.
|
||||
|
||||
2004-02-20 Toshio Kuratomi <toshio@tiki-lounge.com> - r46
|
||||
* egif_lib.c: Note for a bug fix (Can wait until after indent because
|
||||
there's no patch.)
|
||||
* gif_lib.h, dev2gif.c: Change int type to explicit long type in
|
||||
DumpScreen2Gif.
|
||||
* util/gifinto.c: Give the fprintf back its %d format.
|
||||
GifFile->ImageCount is used as the Image number.
|
||||
|
||||
2004-02-20 Toshio Kuratomi <toshio@tiki-lounge.com> - r45
|
||||
* README: add varargs to the deprecation list
|
||||
|
||||
2004-02-20 Toshio Kuratomi <toshio@tiki-lounge.com> - r44
|
||||
* test-unx: Quote the program names.
|
||||
* lib/dgif_lib.c:
|
||||
- Make sure memory was allocated for the colormap
|
||||
- Some reformatting of code but no syntactic changes.
|
||||
* lib/gif_lib.h:
|
||||
- C++ extern "C" fix
|
||||
- Fix typo with EGifOpen
|
||||
* lib/qprintf.c, lib/getarg.c: Update the varargs code. Some users reported
|
||||
that not all systems can handle the hybridized varargs parameter lists
|
||||
we had. Need to use old-style declarations instead.
|
||||
|
||||
2004-02-20 Toshio Kuratomi <toshio@tiki-lounge.com> - r43
|
||||
* NEWS: Note bugfixes and deprecations
|
||||
* README: Deprecation list is now being compiled in this file.
|
||||
* TODO: Notes about interlace bug, -Wall status, merging of old bug status
|
||||
|
||||
2004-02-19 Toshio Kuratomi <toshio@tiki-lounge.com> - r42
|
||||
* Makefile.am: Disable testing for now because gif2x11 is broken so none
|
||||
of the tests _appear_ to complete successfully.
|
||||
|
||||
2004-02-19 Toshio Kuratomi <toshio@tiki-lounge.com> - r38
|
||||
Merge -Wall fixes from branches/Wall-audit r29
|
||||
* configure.ac:
|
||||
- Make the stdarg vs varargs check simpler by relying on
|
||||
AC_CHECK_HEADERS() magic.
|
||||
- Check for unistd.h
|
||||
* dgif_lib.c, gif_lib.h, egif_lib.c, gifalloc.c, quantize.c, dev2gif.c,
|
||||
getarg.c, gif_lib_private.h, gif_font.c gif_err.c, gifinto.c, icon2gif.c,
|
||||
raw2gif.c, gifcolor.c, gifasm.c, gif2epsn.c, gif2iris.c, gifrotat.c,
|
||||
gifovly.c, gif2x11.c, rle2gif.c, gif2rle.c, text2gif.c, gifspnge.c,
|
||||
gifclrmp.c, giffiltr.c, giftext.c, gifinfo.c, rgb2gif.c, gif2rgb.c, gif2ps.c
|
||||
- Changes to get rid of -Wall compile warnings.
|
||||
+ Casting of types
|
||||
+ New header includes for unistd.h and fcntl.h
|
||||
+ Explicit declaration of many types to unsigned
|
||||
+ Removed unused variables and functions
|
||||
+ Removed VersionStr from every library file. Instead include it via
|
||||
gif_lib_private.h
|
||||
* gif_lib.h, gif_lib_private.h: Moved the VersionStr into gif_lib_private.h
|
||||
and made it a #define instead of a static char *.
|
||||
|
||||
2004-02-19 Toshio Kuratomi <toshio@tiki-lounge.com> - r37
|
||||
Deprecation notes
|
||||
|
||||
2004-02-19 Toshio Kuratomi <toshio@tiki-lounge.com> - r36
|
||||
Add notes about security things to do and giflib syncing
|
||||
|
||||
2004-02-18 Toshio Kuratomi <toshio@tiki-lounge.com> - r32
|
||||
* TODO: Add notes about how to go about syncing Wall-audit and indent changes
|
||||
into giflib. It won't be pretty.
|
||||
* svn:ignore: Change the tarball names from libungif to giflib
|
||||
|
||||
2004-02-18 Toshio Kuratomi <toshio@tiki-lounge.com> - r31
|
||||
Add config.h include to gif_hash.c
|
||||
|
||||
2004-02-17 Toshio Kuratomi <toshio@tiki-lounge.com> - r30
|
||||
Sync up with libungif 4.1.1
|
||||
|
||||
2004-02-17 Toshio Kuratomi <toshio@tiki-lounge.com> - r26
|
||||
Updated ChangeLog
|
||||
|
||||
2004-02-17 Toshio Kuratomi <toshio@tiki-lounge.com>
|
||||
* Updated libungif.spec to look more like fedora core spec
|
||||
* Updated version numbers in all files
|
||||
|
||||
2004-02-17 Toshio Kuratomi <toshio@tiki-lounge.com>
|
||||
* Add the libungif*.tar.bz2 distribution tarball to the ignored files
|
||||
* configure.ac, lib/getarg.c, lib/getarg.h, lib/gif_lib.h, lib/qprintf.c:
|
||||
Prefer stdarg.h over vararg.h
|
||||
* TODO: Add information about functions that will go away in 5.0
|
||||
(In reality, I don't think new software uses libungif, so there may never
|
||||
be a 5.0 release.)
|
||||
* lib/gif_lib.h: Change version from 4.0 to 4.1
|
||||
* NEWS: add deprecation warning for the qprintf stuff: GifQuietPrint var and
|
||||
GifQprintf function.
|
||||
|
||||
2004-02-16 Toshio Kuratomi <toshio@tiki-lounge.com>
|
||||
* util/gif2iris.c, util/gif2rle.c, util/gifinfo.c: Fix problems with fprintf error statements in the utils
|
||||
|
||||
2004-02-16 Toshio Kuratomi <toshio@tiki-lounge.com>
|
||||
Add DEVELOPERS file to the distribution.
|
||||
|
||||
2004-02-16 Toshio Kuratomi <toshio@tiki-lounge.com>
|
||||
* AUTHORS, libungif.spec, libungif.lsm, README, BUGS, NEWS:
|
||||
Lots of changes to my email address and the website/download. (libungif is
|
||||
moving to sourceforge.)
|
||||
* TODO: Few notes on cleanups that need to happen. State what needs to be done
|
||||
for 4.1.1 to be released.
|
||||
|
||||
2004-02-15 Toshio Kuratomi <toshio@tiki-lounge.com>
|
||||
Changes imported from last cvs checkout
|
||||
* TODO: note to check return of malloc everywhere
|
||||
* lib/dgif_lib.c, lib/egif_lib.c: Fix some deallocation bugs
|
||||
* lib/gifalloc.c: Fix a colormap allocation problem
|
||||
* lib/gif_font.c: Fix to drawing text
|
||||
|
||||
2004-02-15 Toshio Kuratomi <toshio@tiki-lounge.com>
|
||||
Added libgetarg.a to the ignore list.
|
||||
|
||||
2004-02-15 Toshio Kuratomi <toshio@tiki-lounge.com>
|
||||
Changes to the build infrastructure to build under current libtool, automake,
|
||||
and libtool.
|
||||
* configure.in: renamed to configure.ac
|
||||
* acconfig.h: deleted. Functionality moved into the configure.ac
|
||||
* autogen.sh: now runs libtoolize --automake
|
||||
* lib/Makefile.am, util/Makefile.am: CFLAGS=>AM_CFLAGS; INCLUDES=>AM_CPPFLAGS
|
||||
* configure.ac:
|
||||
- initialization macros for automake and autoconf have changed
|
||||
- removed checks for C++ compiler and Awk
|
||||
- acconfig.h functionality moved here.
|
||||
- add other X11 libraries to the X11_LIB define
|
||||
|
||||
2004-02-15 Toshio Kuratomi <toshio@tiki-lounge.com>
|
||||
* Remove INSTALL file as it's autogenerated.\n* Add stamp-h1 to ignored files
|
||||
|
||||
2004-02-15 Toshio Kuratomi <toshio@tiki-lounge.com>
|
||||
Additional adds and deletes to make version 4.1.0b1
|
||||
|
||||
2004-02-15 Toshio Kuratomi <toshio@tiki-lounge.com>
|
||||
Import of version 4.1.0b1
|
||||
|
||||
2004-02-15 Toshio Kuratomi <toshio@tiki-lounge.com> - r10
|
||||
Import giflib 4.1.0
|
||||
|
||||
2004-02-15 Toshio Kuratomi <toshio@tiki-lounge.com> - r9
|
||||
Copy the 4.1.0 libungif release to be the base of the 4.1.0 giflib release.
|
||||
|
||||
2004-02-15 Toshio Kuratomi <toshio@tiki-lounge.com> - r7
|
||||
Release 4.1.0
|
||||
|
||||
2004-02-15 Toshio Kuratomi <toshio@tiki-lounge.com> - r6
|
||||
Import of version 4.1.0
|
||||
|
||||
2004-02-15 Toshio Kuratomi <toshio@tiki-lounge.com> - r5
|
||||
Set ignore patterns on the project directories.
|
||||
|
||||
2004-02-15 Toshio Kuratomi <toshio@tiki-lounge.com> - r3
|
||||
Remove a Makefile.in that was left in in the first commit.
|
||||
|
||||
2004-02-14 Toshio Kuratomi <toshio@tiki-lounge.com> - r2
|
||||
Commit revision 3.1.0 to subversion
|
||||
|
||||
2004-02-14 Toshio Kuratomi <toshio@tiki-lounge.com> - r1
|
||||
Initial SVN Repository Layout
|
||||
|
||||
2000 6 Feb Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* configure.in: Change to using config.h
|
||||
- Every .c file: Change to using config.h.
|
||||
* configure.in: added check for varargs header.
|
||||
* lib/getarg.c: Changed the ifdef USE_VARARGS to ifdef HAVE_VARARGS_H.
|
||||
- lib/getarg.h: Ditto.
|
||||
- lib/gif_lib.h: Ditto.
|
||||
- lib/qprintf.h: Ditto.
|
||||
|
||||
2000 6 Feb Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* lib/getarg.h: Prepend an underscore to the header file define.
|
||||
* lib/gif_lib.h: Ditto
|
||||
* lib/gif_lib_private.h: Ditto
|
||||
* lib/getarg.c: ifdef'd MyMalloc so it actually won't define if it already
|
||||
is.
|
||||
|
||||
2000 3 Feb Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* A new cvs repository based my private tree from home. It now goes back
|
||||
to giflib-3.0.
|
||||
* Updated the cvs repository to make multiple developers possible.
|
||||
* Merge all of Michael's patches into the distribution.
|
||||
* DEVELOPER: Updated to reflect the new versions of
|
||||
autoconf/automake/libtool we're using.
|
||||
* libungif.spec: Updated a few things from the latest redhat spec file.
|
||||
|
||||
1999 5 Dec Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* Update links to the web pages as I have reorganized them somewhat.
|
||||
* Add the welcome2.gif to the pic directory and a test that utilizes
|
||||
it to test-unx.
|
||||
|
||||
1999 17 Nov Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* New cvs Repository. Hopefully I've got everything that was in the
|
||||
old one. This one is available on anonymous cvs.
|
||||
* Update to libtool 1.3.3, automake 1.4, and autoconf 2.13
|
||||
|
||||
1999 23 May Michael R Brown <michael@arrakeen.demon.co.uk>
|
||||
* Lots of 'const' qualifiers added, thanks Alexis
|
||||
Wilke for finding these.
|
||||
|
||||
1999 22 Mar Michael R Brown <michael@arrakeen.demon.co.uk>
|
||||
* util/gif2x11.c: Patch by (who?) to fix lots of memory leeks.
|
||||
* util/*.c:
|
||||
lib/dgif_lib.c:
|
||||
Makefile.in:
|
||||
Patch by David Kaelbling to compile on IRIX 6.x. Basically fixing
|
||||
lots of bad/missing parameter passing to printf, scanf and similar.
|
||||
* Added pics/welcome2.gif, from Peter Merz which provokes a bug prior
|
||||
to patch 19990224 to do with colour map management. There is still
|
||||
a problem with util/gifspnge processing this image, so it will not
|
||||
be added to test-unx yet.
|
||||
|
||||
1999 05 Mar Michael R Brown <michael@arrakeen.demon.co.uk>
|
||||
* lib/getarg.c: Lines 107 and 189
|
||||
Added ifdef's to use stdarg when available. On dec-alpha the
|
||||
default code was causing programs to crash, probably because
|
||||
it assumes a stack that grows-up.
|
||||
|
||||
1999 24 Feb Michael R Brown <michael@arrakeen.demon.co.uk>
|
||||
* lib/dgif_lib.c: Lines 363 and 367
|
||||
Bug reported by Steve Sanders, where &'s where causing the
|
||||
memcpy to overwrite the pointers. Fixed by removing the &'s
|
||||
so that memcpy overwrote the memory pointed to.
|
||||
|
||||
1999 09 Feb Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* Release 4.1.0
|
||||
|
||||
1999 09 Feb Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* Merge libungif changes into the giflib tree:
|
||||
- upgrade to libtool 1.2b
|
||||
- util/Makefile.am: Minor change to allow compilation outside the
|
||||
source_dir.
|
||||
- lib/egif_lib.c: FILE_STATE_WRITE, FILE_STATE_SCREEN,
|
||||
FILE_STATE_IMAGE, IS_WRITEABLE are now in gif_lib_private.h
|
||||
- lib/dgif_lib.c: FILE_STATE_READ and IS_READABLE are now in
|
||||
gif_lib_private.h
|
||||
- lib/gif_lib_private.h: Above mentioned constants and macros are now
|
||||
here. FILE_STATE_READ is now 0x08 instead of 0x00.
|
||||
- configure.in: Update version to 4.1.0
|
||||
- lib/Makefile.am: Update libtool version to 5:0:1 (libtool)
|
||||
- giflib.spec: Update for version 4.1.0 (Add libungif-4.1
|
||||
compatibility stuff and change version.)
|
||||
- giflib.lsm: Update for version 4.1.0
|
||||
- lib/egif_lib.c: (WRITE) change from a function to a macro.
|
||||
- lib/dgif_lib.c: (DGifOpenFileName) close FileHandle on error.
|
||||
- lib/dgif_lib.c: (DGifOpenFileHandle) make sure the FILE stream is
|
||||
closed if we hit an error.
|
||||
- lib/dev2gif.c, lib/quantize.c, lib/gif_err.c, lib/gif_lib_private.h:
|
||||
Reflect Eric's copyright notice rather than Gershon's
|
||||
|
||||
1999 14 Jan Michael R Brown <michael@arrakeen.demon.co.uk>
|
||||
* lib/gif_lib.h: Add OutputFunc type
|
||||
* lib/gif_lib.h: Add EGifOpen for user supplied output function
|
||||
* lib/egif_lib.c: (EGifOpenFileName) Fixed wasted memory when an
|
||||
error occurs in EGifOpenFileHandle
|
||||
* lib/egif_lib.c: Add EGifOpen, WRITE, and lots of changes to
|
||||
support user supplied output function. Basically changing
|
||||
all fwrite's to WRITE, and then all of the knock on effects.
|
||||
|
||||
1998 17 Dec Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* configure.in: Change references to libungif to giflib.
|
||||
* libungif.lsm: Rename to giflib.lsm and change to reflect giflib
|
||||
rather than libungif.
|
||||
* libungif.spec: Rename to giflib.spec and change to reflect giflib
|
||||
rather than libungif.
|
||||
* UNCOMPRESSED_GIF: Removed from this branch.
|
||||
* PATENT_PROBLEMS: Add file explaining Unisys's patent claims.
|
||||
* Makefile.am: Replace libungif with giflib.
|
||||
* README: Adapted language to giflib.
|
||||
* lib/Makefile.am: Changed references to libungif to libgif.
|
||||
* util/Makefile.am: Changed references to libungif to libgif.
|
||||
|
||||
1998 17 Dec Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* lib/egif_lib.c: Merge LZW stuff into this branch of the library.
|
||||
This includes numerous changes to initialize the hash table as well
|
||||
as the code forthe encoder.
|
||||
* lib/gif_hash.c: Functions needed for the LZW encoder.
|
||||
* lib/gif_hash.h: Functions needed for the LZW encoder.
|
||||
* lib/Makefile.am: Add gif_hash.c gif_hash.h to the list of sources.
|
||||
|
||||
1998 15 Dec Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* lib/dgif_lib.c: (DGifSlurp) Fix a Seg Fault when an image contains
|
||||
no extension blocks.
|
||||
|
||||
1998 14 Dec Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* configure.in: Update version to 4.0
|
||||
* lib/Makefile.am: Update libtool version to 4:0:0 (libtool)
|
||||
* libungif.spec: Update for version 4.0 (not binary compatible with
|
||||
giflib, change version.)
|
||||
* lib/gif_lib_private.h: (PrivateType) New header for common stuff
|
||||
private to the library. Currently, this is only the Private struct.
|
||||
* lib/dgif_lib.c: (PrivateType) Extract the Private struct to
|
||||
gif_lib_private.h
|
||||
* lib/egif_lib.c: (PrivateType) Extract the Private struct to
|
||||
gif_lib_private.h
|
||||
* lib/Makefile.am: Add gif_lib_private.h to the list of source files.
|
||||
* lib/gif_lib.h: (ExtensionBlock) Add a Function entry to the
|
||||
ExtensionBlock record. Note that this is not entirely correct:
|
||||
the GifLib ExtensionBlock structure is actually a data sub-block
|
||||
record. By adding the function entry here, we are pushing the
|
||||
ExtensionBlockType in with the DataSubBlock.
|
||||
Sometime in the future, we need to change the API to have true
|
||||
ExtensionBlocks which have DataSubBlocks belonging to them.
|
||||
* lib/gif_lib.h: (ExtensionBlock) Deprecate the use of Function in
|
||||
the SavedImage struct. Use ExtensionBlock's Function instead.
|
||||
* lib/egif_lib.c: (EGifSpew) Changes to use the new Function variable.
|
||||
* lib/dgif_lib.c: (DGifSlurp) Changes to put data into the new
|
||||
Function variable.
|
||||
|
||||
1998 3 Dec Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* lib/dgif_lib.c: (DGifSlurp) Three changes:
|
||||
- No longer allocate SaveImage in this function. All allocations
|
||||
of SaveImage take place in DGifGetImageDesc.
|
||||
- Extension blocks are now associated with the Image Block that is
|
||||
read in subsequent to them, not before. This should now be
|
||||
conformant to the gif89a specification.
|
||||
- Fix an off-by-one error when copying extension data from structure
|
||||
to structure.
|
||||
* lib/dgif_lib.c: (DGifGetImageDesc) Change the function to do its own
|
||||
allocation of space for the SavedImage structure no matter what.
|
||||
* lib/egif_lib.c: (EGifSpew) The function now spits out
|
||||
ExtensionBlocks before the associated Image Block to conform with
|
||||
the gif89a specification.
|
||||
* lib/egif_lib.c: (EGifOpenFileHandle) Move the write of the
|
||||
GifVersion (gif87a or gif89a) from this function into
|
||||
EGifPutScreenDesc so that it can be controlled by EGifSpew. Note
|
||||
that this is still a hack as the GifVersion write doesn't really
|
||||
belong in either of these functions.
|
||||
* lib/egif_lib.c: (EGifPutScreenDesc) Moved writing the version
|
||||
(gif87a or gif89a) into the file into this function from
|
||||
EGifOpenFileHandle.
|
||||
* test-unx: Now test the extension code.
|
||||
* pic/x-trans.gif: New image with Comments and transparency to test
|
||||
the extension code with.
|
||||
|
||||
1998 29 Nov Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* lib/dgif_lib.c: (DGifSlurp) Fix a few of the minor bugs plaguing
|
||||
this function. At this point, the function should no longer cause
|
||||
a Seg Fault. It is now losing all extension data however. I know
|
||||
how to hack a fix in, but I need to commit these changes first.
|
||||
* lib/dgif_lib.c: (DGifGetImageDesc) Fix my bug fix: the colormap is
|
||||
now only copied if it exists :-).
|
||||
|
||||
1998 10 Nov Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* test-unx: Add a test for DGifSlurp and EGifSpew
|
||||
|
||||
1998 14 Oct Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* lib/dgif_lib.c: (DGifGetImageDesc) Fix a bug where the Colormap for
|
||||
the image description and the SaveImage were pointers to the same
|
||||
structure, causing a SegV when DGifClosing the file.
|
||||
|
||||
1998 9 Oct Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* lib/dgif_lib.c: (DGifSlurp) memory for the extensions was not being
|
||||
allocated. Now I call AddExtensionBlock when I add an extension to
|
||||
the structure. Additionally, fix a memory leak here.
|
||||
* configure.in, NEWS, lib/Makefile.am: Update to version 3.1.1
|
||||
* ltmain.sh, ltconfig: removed from the cvs repository
|
||||
* BUGS: add the BUGS file to list unresolved BUGS.
|
||||
|
||||
1998 9 Sep Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* libungif.spec: Fix wrong version in %files and %install section.
|
||||
|
||||
1998 8 Sep Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* lib/gif_hash.c, lib/gif_hash.h: Removed these because a hash table
|
||||
is not needed to create uncompressed gifs.
|
||||
* lib/egif_lib.c: Remove all references to the hash functions.
|
||||
* lib/Makefile.am: Remove gif_hash.c gif_hash.h from the source files.
|
||||
* libungif.lsm: added this file
|
||||
|
||||
1998 7 Sep Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* lib/dgif_lib.c, lib/gif_lib.h: (DGifOpen) Add callback to read gif
|
||||
image through user supplied function (Peter Mehlitz).
|
||||
|
||||
1998 6 Sep Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
* util/*.{gif.rle}: removed files that were left by my testing
|
||||
process and shouldn't have been in the distribution.
|
||||
* UNCOMPRESSED_GIF: add section on why software that can decode
|
||||
LZW compressed gifs (but not write them) is legal.
|
||||
* .cvsignore: added .cvsignore files to ignore Makefiles and other
|
||||
generated files in my cvs repository.
|
||||
* Makefile.am's: Fixes to allow the dist* family of targets to work
|
||||
correctly. Preliminary support for make check as well.
|
||||
* configure.in: Update version to 3.1.0
|
||||
* lib/Makefile.am: Update libtool version to 4:0:1 libtool)
|
||||
* libungif-3.0.spec: Update from Marc Ewing.
|
||||
* Add int/pointer Alpha fixes from Dick Porter to many source files.
|
||||
@@ -0,0 +1,173 @@
|
||||
# Top-level Unix makefile for the GIFLIB package
|
||||
# Should work for all Unix versions
|
||||
#
|
||||
# If your platform has the OpenBSD reallocarray(3) call, you may
|
||||
# add -DHAVE_REALLOCARRAY to CFLAGS to use that, saving a bit
|
||||
# of code space in the shared library.
|
||||
|
||||
#
|
||||
OFLAGS = -O0 -g
|
||||
OFLAGS = -O2
|
||||
CFLAGS = -std=gnu99 -fPIC -Wall -Wno-format-truncation $(OFLAGS)
|
||||
|
||||
SHELL = /bin/sh
|
||||
TAR = tar
|
||||
INSTALL = install
|
||||
|
||||
PREFIX = /usr/local
|
||||
BINDIR = $(PREFIX)/bin
|
||||
INCDIR = $(PREFIX)/include
|
||||
LIBDIR = $(PREFIX)/lib
|
||||
MANDIR = $(PREFIX)/share/man
|
||||
|
||||
# No user-serviceable parts below this line
|
||||
|
||||
VERSION:=$(shell ./getversion)
|
||||
LIBMAJOR=7
|
||||
LIBMINOR=2
|
||||
LIBPOINT=0
|
||||
LIBVER=$(LIBMAJOR).$(LIBMINOR).$(LIBPOINT)
|
||||
|
||||
SOURCES = dgif_lib.c egif_lib.c gifalloc.c gif_err.c gif_font.c \
|
||||
gif_hash.c openbsd-reallocarray.c
|
||||
HEADERS = gif_hash.h gif_lib.h gif_lib_private.h
|
||||
OBJECTS = $(SOURCES:.c=.o)
|
||||
|
||||
USOURCES = qprintf.c quantize.c getarg.c
|
||||
UHEADERS = getarg.h
|
||||
UOBJECTS = $(USOURCES:.c=.o)
|
||||
|
||||
# Some utilities are installed
|
||||
INSTALLABLE = \
|
||||
gif2rgb \
|
||||
gifbuild \
|
||||
giffix \
|
||||
giftext \
|
||||
giftool \
|
||||
gifclrmp
|
||||
|
||||
# Some utilities are only used internally for testing.
|
||||
# There is a parallel list in doc/Makefile.
|
||||
# These are all candidates for removal in future releases.
|
||||
UTILS = $(INSTALLABLE) \
|
||||
gifbg \
|
||||
gifcolor \
|
||||
gifecho \
|
||||
giffilter \
|
||||
gifhisto \
|
||||
gifinto \
|
||||
gifsponge \
|
||||
gifwedge
|
||||
|
||||
LDLIBS=libgif.a -lm
|
||||
|
||||
all: libgif.so libgif.a libutil.so libutil.a $(UTILS)
|
||||
$(MAKE) -C doc
|
||||
|
||||
$(UTILS):: libgif.a libutil.a
|
||||
|
||||
libgif.so: $(OBJECTS) $(HEADERS)
|
||||
$(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,libgif.so.$(LIBMAJOR) -o libgif.so $(OBJECTS)
|
||||
|
||||
libgif.a: $(OBJECTS) $(HEADERS)
|
||||
$(AR) rcs libgif.a $(OBJECTS)
|
||||
|
||||
libutil.so: $(UOBJECTS) $(UHEADERS)
|
||||
$(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,libutil.so.$(LIBMAJOR) -o libutil.so $(UOBJECTS)
|
||||
|
||||
libutil.a: $(UOBJECTS) $(UHEADERS)
|
||||
$(AR) rcs libutil.a $(UOBJECTS)
|
||||
|
||||
clean:
|
||||
rm -f $(UTILS) $(TARGET) libgetarg.a libgif.a libgif.so libutil.a libutil.so *.o
|
||||
rm -f libgif.so.$(LIBMAJOR).$(LIBMINOR).$(LIBPOINT)
|
||||
rm -f libgif.so.$(LIBMAJOR)
|
||||
rm -fr doc/*.1 *.html doc/staging
|
||||
|
||||
check: all
|
||||
$(MAKE) -C tests
|
||||
|
||||
# Installation/uninstallation
|
||||
|
||||
install: all install-bin install-include install-lib install-man
|
||||
install-bin: $(INSTALLABLE)
|
||||
$(INSTALL) -d "$(DESTDIR)$(BINDIR)"
|
||||
$(INSTALL) $^ "$(DESTDIR)$(BINDIR)"
|
||||
install-include:
|
||||
$(INSTALL) -d "$(DESTDIR)$(INCDIR)"
|
||||
$(INSTALL) -m 644 gif_lib.h "$(DESTDIR)$(INCDIR)"
|
||||
install-lib:
|
||||
$(INSTALL) -d "$(DESTDIR)$(LIBDIR)"
|
||||
$(INSTALL) -m 644 libgif.a "$(DESTDIR)$(LIBDIR)/libgif.a"
|
||||
$(INSTALL) -m 755 libgif.so "$(DESTDIR)$(LIBDIR)/libgif.so.$(LIBVER)"
|
||||
ln -sf libgif.so.$(LIBVER) "$(DESTDIR)$(LIBDIR)/libgif.so.$(LIBMAJOR)"
|
||||
ln -sf libgif.so.$(LIBMAJOR) "$(DESTDIR)$(LIBDIR)/libgif.so"
|
||||
install-man:
|
||||
$(INSTALL) -d "$(DESTDIR)$(MANDIR)/man1"
|
||||
$(INSTALL) -m 644 doc/*.1 "$(DESTDIR)$(MANDIR)/man1"
|
||||
uninstall: uninstall-man uninstall-include uninstall-lib uninstall-bin
|
||||
uninstall-bin:
|
||||
cd "$(DESTDIR)$(BINDIR)" && rm -f $(INSTALLABLE)
|
||||
uninstall-include:
|
||||
rm -f "$(DESTDIR)$(INCDIR)/gif_lib.h"
|
||||
uninstall-lib:
|
||||
cd "$(DESTDIR)$(LIBDIR)" && \
|
||||
rm -f libgif.a libgif.so libgif.so.$(LIBMAJOR) libgif.so.$(LIBVER)
|
||||
uninstall-man:
|
||||
cd "$(DESTDIR)$(MANDIR)/man1" && rm -f $(shell cd doc >/dev/null && echo *.1)
|
||||
|
||||
# Make distribution tarball
|
||||
#
|
||||
# We include all of the XML, and also generated manual pages
|
||||
# so people working from the distribution tarball won't need xmlto.
|
||||
|
||||
EXTRAS = README \
|
||||
NEWS \
|
||||
TODO \
|
||||
COPYING \
|
||||
getversion \
|
||||
ChangeLog \
|
||||
build.adoc \
|
||||
history.adoc \
|
||||
control \
|
||||
doc/whatsinagif \
|
||||
doc/gifstandard \
|
||||
|
||||
DSOURCES = Makefile *.[ch]
|
||||
DOCS = doc/*.xml doc/*.1 doc/*.html doc/index.html.in doc/00README doc/Makefile
|
||||
ALL = $(DSOURCES) $(DOCS) tests pic $(EXTRAS)
|
||||
giflib-$(VERSION).tar.gz: $(ALL)
|
||||
$(TAR) --transform='s:^:giflib-$(VERSION)/:' -czf giflib-$(VERSION).tar.gz $(ALL)
|
||||
giflib-$(VERSION).tar.bz2: $(ALL)
|
||||
$(TAR) --transform='s:^:giflib-$(VERSION)/:' -cjf giflib-$(VERSION).tar.bz2 $(ALL)
|
||||
|
||||
dist: giflib-$(VERSION).tar.gz giflib-$(VERSION).tar.bz2
|
||||
|
||||
# Auditing tools.
|
||||
|
||||
# Check that getversion hasn't gone pear-shaped.
|
||||
version:
|
||||
@echo $(VERSION)
|
||||
|
||||
# cppcheck should run clean
|
||||
cppcheck:
|
||||
cppcheck --inline-suppr --template gcc --enable=all --suppress=unusedFunction --force *.[ch]
|
||||
|
||||
# Verify the build
|
||||
distcheck: all
|
||||
$(MAKE) giflib-$(VERSION).tar.gz
|
||||
tar xzvf giflib-$(VERSION).tar.gz
|
||||
$(MAKE) -C giflib-$(VERSION)
|
||||
rm -fr giflib-$(VERSION)
|
||||
|
||||
# release using the shipper tool
|
||||
release: all distcheck
|
||||
$(MAKE) -C doc website
|
||||
shipper --no-stale version=$(VERSION) | sh -e -x
|
||||
rm -fr doc/staging
|
||||
|
||||
# Refresh the website
|
||||
refresh: all
|
||||
$(MAKE) -C doc website
|
||||
shipper --no-stale -w version=$(VERSION) | sh -e -x
|
||||
rm -fr doc/staging
|
||||
@@ -0,0 +1,784 @@
|
||||
GIFLIB NEWS
|
||||
|
||||
|
||||
Version 5.2.1
|
||||
==============
|
||||
|
||||
This is the "Maybe I shouldn't have dome a release while imn surgical recovery" release.
|
||||
|
||||
* In gifbuild.c, avoid a core dump on no color map.
|
||||
|
||||
* Restore inadvertently removed library version numbers in Makefile.
|
||||
|
||||
Version 5.2.0
|
||||
=============
|
||||
|
||||
The undocumented and deprecated GifQuantizeBuffer() entry point
|
||||
has been moved to the util library to reduce libgif size and attack
|
||||
surface. Applications needing this function are couraged to link the
|
||||
util library or make their own copy.
|
||||
|
||||
The following obsolete utility programs are no longer installed:
|
||||
gifecho, giffilter, gifinto, gifsponge. These were either installed in
|
||||
error or have been obsolesced by modern image-transformmation tools
|
||||
like ImageMagick convert. They may be removed entirely in a future
|
||||
release.
|
||||
|
||||
* Address SourceForge issue #136: Stack-buffer-overflow in gifcolor.c:84
|
||||
|
||||
* Address SF bug #134: Giflib fails to slurp significant number of gifs
|
||||
|
||||
* Apply SPDX convention for license tagging.
|
||||
|
||||
Version 5.1.9
|
||||
=============
|
||||
|
||||
The documentation directory now includes an HTMlified version of the
|
||||
GIF89 standard, and a more detailed description of how LZW compression
|
||||
is applied to GIFs.
|
||||
|
||||
* Address SF bug #129: The latest version of giflib cannot be build on windows.
|
||||
|
||||
* Address SF bug #126: Cannot compile giflib using c89
|
||||
|
||||
Version 5.1.8
|
||||
=============
|
||||
|
||||
* Address SF bug #119: MemorySanitizer: FPE on unknown address
|
||||
|
||||
* Address SF bug #125: 5.1.7: xmlto is still required for tarball
|
||||
|
||||
* Address SF bug #124: 5.1.7: ar invocation is not crosscompile compatible
|
||||
|
||||
* Address SF bug #122: 5.1.7 installs manpages to wrong directory
|
||||
|
||||
* Address SF bug #121: make: getversion: Command not found
|
||||
|
||||
* Address SF bug #120: 5.1.7 does not build a proper library - no
|
||||
|
||||
Version 5.1.7
|
||||
=============
|
||||
|
||||
Correct a minor packaging error (superfluous symlinks) in the 5.1.6 tarballs.
|
||||
|
||||
Version 5.1.6
|
||||
=============
|
||||
|
||||
Build Fixes
|
||||
-----------
|
||||
|
||||
Fix library installation in the Makefile.
|
||||
|
||||
Version 5.1.5
|
||||
=============
|
||||
|
||||
Code Fixes
|
||||
----------
|
||||
|
||||
* Fix SF bug #114: Null dereferences in main() of gifclrmp
|
||||
|
||||
* Fix SF bug #113: Heap Buffer Overflow-2 in function DGifDecompressLine()
|
||||
in cgif.c. This had been assigned CVE-2018-11490.
|
||||
|
||||
* Fix SF bug #111: segmentation fault in PrintCodeBlock
|
||||
|
||||
* Fix SF bug #109: Segmentation fault of giftool reading a crafted file
|
||||
|
||||
* Fix SF bug #107: Floating point exception in giftext utility
|
||||
|
||||
* Fix SF bug #105: heap buffer overflow in DumpScreen2RGB in gif2rgb.c:317
|
||||
|
||||
* Fix SF bug #104: Ineffective bounds check in DGifSlurp
|
||||
|
||||
^ Fix SF bug #103: GIFLIB 5.1.4: DGifSlurp fails on empty comment
|
||||
|
||||
* Fix SF bug #87: Heap buffer overflow in 5.1.2 (gif2rgb).
|
||||
|
||||
Build Fixes
|
||||
-----------
|
||||
|
||||
The horrible old autoconf build system has been removed with extreme prejudice.
|
||||
You now build this simply by running "make" from the top-level directory.
|
||||
|
||||
Version 5.1.4
|
||||
=============
|
||||
|
||||
Code Fixes
|
||||
----------
|
||||
|
||||
* Fix SF bug #94: giflib 5 loves to fail to load images... a LOT.
|
||||
|
||||
* Fix SF Bug #92: Fix buffer overread in gifbuild.
|
||||
|
||||
* Fix SF Bug #93: Add bounds check in gifbuild netscape2.0 path
|
||||
|
||||
* Fix SF Bug #89: Fix buffer overread in gifbuild.
|
||||
|
||||
Version 5.1.3
|
||||
=============
|
||||
|
||||
As of this version the library and code has been seriously abused by fuzzers,
|
||||
smoking out crash bugs (now fixed) induced by various kinds of severely
|
||||
malformed GIF.
|
||||
|
||||
Code Fixes
|
||||
----------
|
||||
|
||||
* Prevent malloc randomess from causing the header output routine to emit
|
||||
a GIF89 version string even when no GIF89 features are present. Only
|
||||
breaks tests, not production code, but it's odd this wasn't caught sooner.
|
||||
|
||||
* Prevent malloc randomess from producing sporadic failures by causing
|
||||
sanity checks added in 5.1.2 to misfire.
|
||||
|
||||
* Bulletproof gif2rgb against 0-height images. Addressed SF bug #78:
|
||||
Heap overflow in gif2rgb with images of size 0, also SF bug #82.
|
||||
|
||||
* Remove unnecessary duplicate EGifClose() in gifcolor.c. Fixes SF bug #83
|
||||
introduced in 5.1.2.
|
||||
|
||||
* Fix SF Bug #84: incorrect return of DGifSlurp().
|
||||
|
||||
Version 5.1.2
|
||||
=============
|
||||
|
||||
Code Fixes
|
||||
----------
|
||||
|
||||
* Code hardening using reallocarray() from OpenBSD.
|
||||
|
||||
* Sanity check in giffilter catches files with malformed extension records
|
||||
Fixes SourceForge bug #63: malformed gif causes segfault in giffilter.
|
||||
|
||||
* Inexpensive sanity check in DGifSlurp() catches malformed files with
|
||||
no image descriptor. Fixes SourceForge bug #64: malformed gif causes
|
||||
crash in giftool.
|
||||
|
||||
* Fix SourceForge bug #66: GifDrawBoxedText8x8() modifying constant input
|
||||
parameter.
|
||||
|
||||
* Bail out of GIF read on invalid pixel width. Addresses Savannah bug
|
||||
#67: invalid shift in dgif_lib.c
|
||||
|
||||
* Fix SourceForge bug #69: #69 Malformed: Gif file with no extension
|
||||
block after a GRAPHICS_EXT_FUNC_CODE extension causes segfault (in
|
||||
giftext).
|
||||
|
||||
* Fix SourceForge bug #71: Buffer overwrite when giffixing a malformed gif.
|
||||
|
||||
* Fix SourceForge bug #73: Null pointer deference in gifclrmap (only
|
||||
reachable with malformed GIF).
|
||||
|
||||
* Fix SourceForge bug #74: Double free in gifsponge under 5.1.1,
|
||||
for any valid gif image.
|
||||
|
||||
* Fix SourceForge bug #75: GAGetArgs overflows due to uncounted use of va_arg.
|
||||
|
||||
* Sanity check in giffix catches some malformed files. Addresses
|
||||
SourceForge bug #77: dgif_lib.c: extension processing error
|
||||
|
||||
|
||||
Version 5.1.1
|
||||
=============
|
||||
|
||||
Code Fixes
|
||||
----------
|
||||
|
||||
* Numerous minor fixes in getarg.c. Affects only the utilities, not the
|
||||
core library.
|
||||
|
||||
* Fix SourceForge bug #59: DGifOpen can segfault if DGifGetScreenDesc fails.
|
||||
|
||||
* SourceForge patch #20: In gifalloc, fix usage of realloc() in case of failure.
|
||||
|
||||
* Fix SourceForge bug #61 Leak in gifsponge.
|
||||
|
||||
Build Fixes
|
||||
----------
|
||||
|
||||
* glibtoolize port fix for OS X.
|
||||
|
||||
Version 5.1.0
|
||||
=============
|
||||
|
||||
Changes to the API require a library major-version bump.
|
||||
|
||||
Code Fixes
|
||||
----------
|
||||
|
||||
* A small change to the API: DGifClose() and EGifClose() now take a
|
||||
pointer-to-int second argument (like the corresponding openers)
|
||||
where a diagnostic code will be deposited when they return
|
||||
GIF_ERROR. This replaces the old behavior in which the GifFile
|
||||
structure was left unfreed so the Error member in it could be filled
|
||||
and remain available. The change was was required because it's
|
||||
not always possible to free the struct afterwards. Case in point is
|
||||
a C# wrapper for giflib (or any language/environment where you can't
|
||||
just free objects allocated in a foreign shared library.)
|
||||
|
||||
* Minor fix for SF bug #56; BitsPerPixel may be left as uninitialized
|
||||
value when reading (truncated) gif.
|
||||
|
||||
* Applied SF patch #17: Use a fallback on Windows where mkstemp is not
|
||||
available.
|
||||
|
||||
* Applied SF patch #15: Code hardening, preventing spurious
|
||||
defective-image messages.
|
||||
|
||||
Retirements
|
||||
-----------
|
||||
|
||||
* Removed gif2raw from utils. Its blithe assumption that the EGA16
|
||||
palette is a reliable default is now about 20 years obsolete. Format
|
||||
conversion is better done with convert(1) from the ImageMagick suite,
|
||||
anyway.
|
||||
|
||||
Version 5.0.6
|
||||
=============
|
||||
|
||||
Minor fix for a rare memory leak (SF bug #55).
|
||||
|
||||
MinGW port fixes.
|
||||
|
||||
Repair the internal quantization function used in gif2rgb so it's
|
||||
less vulnerable to cross-platform skew due to qsort() being unstable.
|
||||
This shouldn't affect production use, it's just a cross-platform
|
||||
issue for regression testing
|
||||
|
||||
Version 5.0.5
|
||||
=============
|
||||
|
||||
Set the error return properly when a screen descriptor read fails.
|
||||
Fixes for some minor API documentation bugs. Some internal manual
|
||||
pages are not to be installed.
|
||||
|
||||
Version 5.0.4
|
||||
=============
|
||||
|
||||
Fix for a rare misrendering bug when a GIF overruns the decompression-code
|
||||
table. The image on which this was spotted was a relatively long-running
|
||||
animated GIF; still images of ordinary size should have been immune.
|
||||
|
||||
Version 5.0.3
|
||||
=============
|
||||
|
||||
Fix a build-system glitch so it will install manpages.
|
||||
|
||||
Version 5.0.2
|
||||
=============
|
||||
|
||||
Documentation and polish
|
||||
------------------------
|
||||
* Partial build is now possible on systems without xmlto.
|
||||
|
||||
Code Fixes
|
||||
----------
|
||||
* Change unused return of EGifSetGifVersion() to void.
|
||||
* Buffer overrun prevention in gifinto.
|
||||
|
||||
Version 5.0.1
|
||||
=============
|
||||
|
||||
Documentation and polish
|
||||
------------------------
|
||||
* There is now an installable manual page for the GIFLIB utility kit.
|
||||
|
||||
Retirements
|
||||
-----------
|
||||
* gifinter is gone. Use "convert -interlace line" from the ImageMagick suite.
|
||||
|
||||
Code Fixes
|
||||
----------
|
||||
* In 5.0.0 the private gif89 bit wasn't being guaranteed cleared at
|
||||
the beginning of EGifGetGifVersion(); this occasionally led to an
|
||||
incorrect version prefix being issued dependent on the state of
|
||||
malloced memory.
|
||||
* An EGifSetGifVersion() function taking a GifFile argument has been
|
||||
added for use with the low-level sequential API. This change requires
|
||||
a bump of the library revision number.
|
||||
|
||||
Version 5.0.0
|
||||
=============
|
||||
|
||||
Changes to the API require a library major-version bump. Certain
|
||||
initialization functions have acquired an integer address argument for
|
||||
passing back an error code, in order to avoid thread-unsafe static
|
||||
storage. Application code using extension blocks will require minor
|
||||
changes. A few functions have been renamed.
|
||||
|
||||
Code Fixes
|
||||
----------
|
||||
* Fixes applied for CVE-2005-2974 and CVE-2005-3350
|
||||
This closes Debian bug #337972.
|
||||
|
||||
New API Features
|
||||
----------------
|
||||
|
||||
Thread Safety
|
||||
~~~~~~~~~~~~~
|
||||
The library is now completely re-entrant and thread-safe.
|
||||
|
||||
* Library error handling no longer uses a static cell to store the last
|
||||
error code registered; that made the library thread-unsafe. For functions
|
||||
other than GIF file openers, the code is now put in an Error member of
|
||||
the GifFileType structure. The GifError() and GifLastError() functions
|
||||
that referenced that static cell are gone, and the GifErrorString()
|
||||
function introduced in the 4.2 release now takes an explicit error code
|
||||
argument.
|
||||
* GIF file openers - DGifOpenFileName(), DGifOpenFileHandle(), DGifOpen(),
|
||||
EGifOpenFileName(), EGifOpenFileHandle(), and EGifOpen() - all now take
|
||||
a final integer address argument. If non-null, this is used to pass
|
||||
back an error code when the function returns NULL.
|
||||
|
||||
Extensions
|
||||
~~~~~~~~~~
|
||||
The ExtensionBlock API has been repaired, solving some problems with GIF89
|
||||
extension handling in earlier versions.
|
||||
|
||||
* DGifSlurp() and EGifSpew() now preserve trailing extension blocks with
|
||||
no following image file.
|
||||
* Three documented functions - EGifPutExtensionFirst(), EGifPutExtensionNext(),
|
||||
and EGifPutExtensionLast() - have been relaced by new functions
|
||||
EGifPutExtensionLeader(), EGifPutExtensionBlock(), and
|
||||
EGifPutExtensionTrailer(). See the Compatibility section of
|
||||
the library API documentation for details.
|
||||
* New functions DGifSavedExtensionToGCB() and EGifGCBToSavedExtension()
|
||||
make it easy to read and edit GIF89 graphics control blocks in saved images.
|
||||
|
||||
Namespacing
|
||||
~~~~~~~~~~~
|
||||
All functions exported by giflib now have DGif, EGif, or Gif as a name prefix.
|
||||
|
||||
* Three documented functions - MakeMapObject(), FreeMapObject(), and
|
||||
UnionColorMap() - have been renamed to GifMakeMapObject(),
|
||||
GifFreeMapObject(), and GifUnionColorMap() respectively.
|
||||
* The library Draw* functions are now prefixed GifDraw*, and the
|
||||
text-drawing ones are suffixed with "8x8". This fixes a conflict
|
||||
with the Windows API and leaves the door open for more general text-drawing
|
||||
functions with different font sizes.
|
||||
|
||||
Other changes
|
||||
~~~~~~~~~~~~~
|
||||
* DGifSlurp() and EGifSpew() now read and write interlaced images properly.
|
||||
* The amazingly obscure colormap sort flag and pixel aspect ratio
|
||||
features of GIF are now read and preserved, for whatever good that
|
||||
may do.
|
||||
* Six undocumented functions have been renamed; five of these take additional
|
||||
or slightly different argument types. See the Compatibility section of
|
||||
the library API documentation for details.
|
||||
* There's now an EGifGetGifVersion() that computes the version EGifSpew()
|
||||
will write.
|
||||
* QuantizeBuffer() has been returned to the core library as GifQuantizeBuffer()
|
||||
- turns out some important applications (notably mplayer) were using it.
|
||||
* TRUE and FALSE macros are gone, also VoidPtr. No more namespace pollution.
|
||||
* Various arguments have been made const where possible.
|
||||
|
||||
Retirements
|
||||
-----------
|
||||
* The (undocumented) gifinfo utility is gone. Use giftool -f instead.
|
||||
* The gifburst utility is gone. Everybody has image viewers that
|
||||
can pan now, and removing it gets rid of a dependency on Perl.
|
||||
* gifcompose is gone. It was a decent idea when I wrote it in 1989,
|
||||
but I did the same thing better and cleaner a decade later with
|
||||
PILdriver in the PIL package. Removing it gets rid of a dependency
|
||||
on shell.
|
||||
* gif2x11 gifasm, gifcomb, gifflip, gifovly, gifpos, gifresize, and gifrotate
|
||||
are all gone. The ImageMagick display(1)/convert(1) utilities and PILdriver
|
||||
do these things better and in a format-independent way.
|
||||
* Lennie Araki's Windows C++ wrapper is gone. It's eight years old,
|
||||
unmaintained, he has dropped out of sight, and a better one needs to
|
||||
be written to use the high-level GIFLIB API and GIF89 graphics
|
||||
control extension support. We'll carry such a wrapper when we have
|
||||
a maintainer for it.
|
||||
* EGifSetVersion(), introduced in 4.2, is gone. The library always
|
||||
writes GIF87 or GIF89 as required by the data. This change helps
|
||||
with thread safety.
|
||||
|
||||
Utilities
|
||||
---------
|
||||
* Several utilities have been renamed to (a) fix last-century's habit
|
||||
of arbitarily smashing vowels out of names to make them just one or two
|
||||
characters shorter, (b) ensure that every utility in this set has 'gif'
|
||||
as a name prefix. Here's the list:
|
||||
|
||||
giffiltr -> giffilter
|
||||
gifspnge -> gifsponge
|
||||
icon2gif -> gifbuild
|
||||
text2gif -> gifecho
|
||||
raw2gif -> gif2raw
|
||||
|
||||
* To go with its new name, gif2raw now dumps raw pixels from a GIF if the
|
||||
(previously required) size option is missing.
|
||||
* Standalone rgb2gif is gone; the same capability is now a mode of gif2rgb.
|
||||
* giftext displays the parsed contents of GIF89 graphics control blocks.
|
||||
* gifbuild handles GIF89 graphics control blocks and Netscape animation
|
||||
loop blocks; it can can display and update either.
|
||||
* gifrotate and other filter utilities now preserve extension blocks,
|
||||
including the graphics control information for transparency and delay time.
|
||||
* A new utility, giftool, supports a wide variety of filtering operations
|
||||
on GIFs, including: setting background and transparency colors, changing
|
||||
interlacing, setting image delays, setting the user-input flag, and setting
|
||||
the aspect-ratio byte. It can sequence multiple operations.
|
||||
* The test-pattern generators gifbg, gifcolor, gihisto and gifwedge and the
|
||||
code templates giffilter and gifsponge are no longer installed by default.
|
||||
|
||||
Documentation and polish
|
||||
------------------------
|
||||
* The history.txt and build.txt and files from 4.2.0 now have .asc extensions
|
||||
to indicate that they use asciidoc markup, contrasting with the txt
|
||||
standards files from CompuServe.
|
||||
* The documentation now includes "What's In A GIF", a very detailed narrative
|
||||
description of the file format.
|
||||
* The -A option of gifasm (for inserting a loop control block) is documented.
|
||||
* The documentation directory includes a copy of the original GIF87
|
||||
specification as well as GIF89's.
|
||||
* The project now has a logo.
|
||||
|
||||
Version 4.2.0
|
||||
=============
|
||||
|
||||
Now maintained by ESR again after handoff by Toshio Kuratomi.
|
||||
|
||||
Code Fixes
|
||||
----------
|
||||
* Code updated internally to C99 to enable more correctness checks by
|
||||
the compiler. Compiles under GCC 4.6.1 without errors or warnings.
|
||||
* A rare resource leak in the colormap-object maker was found with
|
||||
Coverity and fixed.
|
||||
* The code now audits clean under Coverity and cppcheck.
|
||||
* splint cleanup begun, there's a lot of work still to do on this.
|
||||
|
||||
New API Features
|
||||
----------------
|
||||
* The default GIF version to write is now computed at write time from
|
||||
the types of an image's extension blocks, but can be overridden with
|
||||
EGifSetGifVersion().
|
||||
* EGifSpew() is now thread-safe.
|
||||
* Two new functions, GifError() and GifErrorString(),
|
||||
return the error state in a form that can be used by programs.
|
||||
* Two library functions - EGifOpenFileName() and EGifPutImageDesc() -
|
||||
now have bool rather than int flag arguments. Since bool is a
|
||||
typedef of int and TRUE/FALSE have been redefined to true/false,
|
||||
both source and object compatibility with older library versions
|
||||
should be preserved.
|
||||
* GAGetArgs(), used only in the utilities, now returns bool rather
|
||||
than int.
|
||||
* The undocumented GIF_LIB_VERSION symbol is gone from the library header.
|
||||
It has been replaced with three documented symbols: GIFLIB_MAJOR,
|
||||
GIFLIB_MINOR, and GIFLIB_RELEASE.
|
||||
|
||||
Retirements
|
||||
-----------
|
||||
* The gif2epsn and gif2iris utilities are gone. They were full of
|
||||
platform dependencies for platforms long dead. There are enough
|
||||
platform-independent GIF viewers in the world that these weren't
|
||||
adding any value. Removing these gets rid of a dependency on GL.
|
||||
* The rle2gif, gif2rle, and gif2ps utilities are also gone. There are enough
|
||||
multiformat image converters in the world that these weren't adding
|
||||
any value either. Removing them reduces the codebase's dependencies.
|
||||
* The undocumented DumpScreen2Gif() is gone from the library. The
|
||||
only non-obsolete capture mode it supported was through X, and that
|
||||
probably hasn't been used in years and is replaceable by any number
|
||||
of capture utilities. Dropping this code makes the library's
|
||||
portability issues go away.
|
||||
* QuantizeBuffer(), GifQprintf(), PrintGifError(), GIF_ERROR()
|
||||
and GIF_MESSAGE() have been removed from the core library.
|
||||
They were used only by the utilities. QuantizeBuffer() has been
|
||||
inlined where it was used and the latter three are now part of the
|
||||
utility support library.
|
||||
* The Game Boy Advanced test code is gone. The platform was discontinued
|
||||
in 2008; more to the point, nobody ever documented the code's assumptions
|
||||
or expected results.
|
||||
* The Changelog file is now retained for archival purposes only, and because
|
||||
autotools throws a hissy fit if there isn't one. The single point of
|
||||
truth about changes and the reasons for them is the repository history.
|
||||
|
||||
Behavior changes
|
||||
----------------
|
||||
* The -q option of the utilities is replaced by an opposite -v (verbose)
|
||||
option; the default is now quiet for all platforms. Defaulting to chattiness
|
||||
on MSDOS made sense in a world of slow text consoles, but not today.
|
||||
|
||||
Testing
|
||||
-------
|
||||
* There is now a proper regression-test suite; run 'make' in tests/.
|
||||
The old test-unx script is now tests/visual-check and can be run
|
||||
occasionally for a check with the Mark One Eyeball.
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
* Build instructions now live in build.txt
|
||||
* An overview of the giflib API now lives in api.txt.
|
||||
* Documentation is now in DocBook-XML, so either HTML or man pages can
|
||||
be generated from it.
|
||||
|
||||
Version 4.1.6
|
||||
=============
|
||||
Brown paper bag release. Fix a problem with header inclusion that could
|
||||
prevent the library from building on some platforms.
|
||||
|
||||
Version 4.1.5
|
||||
=============
|
||||
This version has some important fixes for segfaults when working with corrupt
|
||||
files. All users are strongly encouraged to upgrade.
|
||||
|
||||
Code Fixes
|
||||
----------
|
||||
* Fix segfault in utilities due to referencing ColorMaps in GifFiles that had
|
||||
no ColorMap present.
|
||||
* Fix gif2x11 to work on 24 bit displays.
|
||||
* Fix for giftext segfault when the GifFile does not store a global colormap.
|
||||
* Checks to fail gracefully when an image contains improper LZ codes.
|
||||
* Close file handles on failure in DGifOpenFileHandle()
|
||||
* Checks to operate on files in binary mode on WIN32 as well as MSDOS.
|
||||
|
||||
Building
|
||||
--------
|
||||
* Add checks to make building on Win32 easier.
|
||||
* Allow turning off gl_s, rle, and X11 support from the configure command line.
|
||||
* Fix for finding a 32 bit integer type on some platforms.
|
||||
* Only enable -Wall if we're using gcc.
|
||||
|
||||
Version 4.1.4
|
||||
=============
|
||||
This version fixes some bugs with deallocating ColorMaps. Fix building on
|
||||
several platforms. Fix x86_64 builds to not hang the encoder.
|
||||
|
||||
* Fix several areas in decoding where we removed a ColorMap from our GifFile
|
||||
but didn't set the pointer to NULL. This could lead to double free's of
|
||||
the ColorMap.
|
||||
* Fix a bug in dev2gif.c where we redefined some gl types incorrectly.
|
||||
* Fix a bug in the gif LZW encoder that was triggered on modern 64 bit
|
||||
platforms.
|
||||
* Fix building on Windows. Note -- there has been one API changing event for
|
||||
Windows (renaming DrawText to DrawGifText.) This should have conflicted with
|
||||
Windows API and therefore caused the builds to fail previously. If you had
|
||||
it working with DrawText before, apologies, you'll need to change to
|
||||
DrawGifText in your code. This only affects Windows.
|
||||
* Add support for building on The Game Boy Advance. Note: Due to the GBA's
|
||||
limited memory, the API for the GBA uses short's in many places where the
|
||||
other platforms use ints. This shouldn't affect anyone unless you've
|
||||
been able to get an older version of the code to run on GBA and want to
|
||||
start using this version instead. A recompile of your dependent code
|
||||
will be necessary in this case.
|
||||
|
||||
Version 4.1.3
|
||||
=============
|
||||
This version fixes some bugs in the Extension writing code in
|
||||
EGifPutExtensionFirst, Next, and Last. Using these functions, it is possible
|
||||
to output extensions that contain multiple subblocks. Additionally, library
|
||||
code has been updated to use these functions, making it safe to output
|
||||
long Comments, and multi-block extensions read in from another file.
|
||||
|
||||
* giflib is now hosted on sourceforge with libungif:
|
||||
http://sourceforge.net/projects/libungif
|
||||
* Make the EGifPutExtension{First,Next,Last} family of functions use WRITE
|
||||
so user defined WRITE methods will output them correctly.
|
||||
* Modify EGifSpew and EGifPutComment to use EGifPutExtension{First,Next,Last}
|
||||
so we won't output broken GIFs when dealing with GIFs with multiple
|
||||
subblocks.
|
||||
* More -Wall fixes revealed while testing on Solaris and FreeBSD.
|
||||
* Updated the gif_lib.html documentation to not use EGifPutExtension when
|
||||
dealing with multiple subblocks. Use EGifPutExtension{First,Next,Last}
|
||||
instead.
|
||||
* Some Windows code from the old CVS repository now available in the windows
|
||||
subdirectory. I don't have a Windows environment to test and maintain this
|
||||
but maybe someone out there will find it useful. Caveat hacker.
|
||||
|
||||
Version 4.1.2
|
||||
=============
|
||||
* Numerous bug fixes from people on the old libungif mailing list.
|
||||
* GIF_ERROR and GIF_MESSAGE are on the deprecation list as they are also
|
||||
utility helper functions rather than essential to the functioning of the
|
||||
library.
|
||||
* Complete deprecation list is now in the README file
|
||||
* Audited the sources with gcc -Wall. Everything detectable has now been fixed.
|
||||
* Ran the library code through indent.
|
||||
|
||||
Version 4.1.1
|
||||
=============
|
||||
* Merge in many bug fixes that were sent in while I was hiking the
|
||||
Appalachian Trail.
|
||||
* The qprintf methods of the library are now deprecated. Do not use
|
||||
GifQuietPrint or GifQprintf. These should have been pushed out into the
|
||||
utility helper library instead of sitting around in the library proper at
|
||||
the same time as the getarg functions were moved out. Getting rid of these
|
||||
will let us get rid of our dependence on stdarg.h/varargs.h (Which a Gif
|
||||
reading library has no business requiring.)
|
||||
|
||||
Version 4.1.0
|
||||
=============
|
||||
* Several minor memory leaks in error conditions have been plugged.
|
||||
* New Function EGifOpen(void *userData, OutputFunc writeFunc) allows user
|
||||
specified gif writing functions.
|
||||
* Old copyright notices in a few source files have been updated. All library
|
||||
copyrights should now reflect the copyright notice in the COPYING file.
|
||||
|
||||
Version 4.0.0 -- giflib
|
||||
=======================
|
||||
This version of the giflib library merges Eric Raymond's giflib-3.0 release
|
||||
with the libungif-4.0 release to give people a binary compatible choice
|
||||
between the two libraries and gives me the chance to add bugfixes to giflib
|
||||
that have been incorporated in libungif.
|
||||
|
||||
PLEASE READ THE FILE PATENT_PROBLEMS BEFORE USING THIS LIBRARY!
|
||||
|
||||
Version 4.0.0
|
||||
=============
|
||||
Major fixes have been made to the code that handles Extensions.
|
||||
Unfortunately, this causes binary incompatibility with giflib-3.0 and
|
||||
libungif-3.x. However, the API is still intact. I am, however, deprecating
|
||||
the use of saveImage[x].Function. Use
|
||||
saveImage[x].ExtensionBlocks[y].Function instead.
|
||||
|
||||
Version 3.1.1
|
||||
=============
|
||||
The following bugs which caused SegFaults have been fixed:
|
||||
* When reading gif files with extensions, DGifSlurp would violate memory.
|
||||
* When closing a gif that had a local colormap, DGifCloseFile would attempt
|
||||
to free the colormap twice.
|
||||
* Fix a potential memory leak in DGifSlurp.
|
||||
* New function DGifOpen to allow specifying a user definable gif reading
|
||||
function.
|
||||
|
||||
Version 3.1.0
|
||||
=============
|
||||
* Add a new function:
|
||||
GifFileType *DGifOpen(void * userData, InputFunc readFunc)
|
||||
to read the gif image from a user defined input function.
|
||||
* A few bugfixes.
|
||||
|
||||
Version 3.0
|
||||
===========
|
||||
|
||||
Changes from Eric Raymond's libgif
|
||||
----------------------------------
|
||||
* A new gif encoder that makes uncompressed gifs rather than standard,
|
||||
LZW-compressed gifs. This is actually the major motivating factor behind
|
||||
libungif; to provide third-party distributors a means to provide a gif
|
||||
library without the patented LZW encoder.
|
||||
* A new configure script to make compilation of the library on multiple
|
||||
platforms easier. The package should now build shared libraries on all
|
||||
platforms supported by GNU libtool.
|
||||
* Removed the getarg functions from libgif. These were not part of the
|
||||
public API and only used by the tools in the utils directory so I separated
|
||||
them from the rest of the library.
|
||||
* Fixed a few bugs in the tools in the utils directory.
|
||||
|
||||
Version 3.0
|
||||
===========
|
||||
|
||||
New features
|
||||
------------
|
||||
* Incorporated Sirtaj Kang's changes to make both static and shared libs.
|
||||
* All the utility and library docs are HTML now.
|
||||
* The library and relevant utilities are now fully GIF89-aware.
|
||||
* Functions for drawing text and boxes on saved images are documented.
|
||||
* The distribution is now issued under a simple X-Consortium-style license.
|
||||
* Can now generate package RPMs and LSM automatically.
|
||||
* Home page with Web-acessible documentation at http://www.ccil.org/~esr/giflib
|
||||
|
||||
Bug fixes
|
||||
---------
|
||||
* Fix giftext to not core dump on a null extension record.
|
||||
* Incorporate Philip VanBaren's change to prevent a core dump in gifasm.
|
||||
|
||||
Version 2.3
|
||||
===========
|
||||
* Fixed a core-dump bug in gifcomb revealed by ELF environment in Linux 1.2.13.
|
||||
|
||||
Version 2.2b
|
||||
============
|
||||
* Added gifburst tool.
|
||||
|
||||
Version 2.2
|
||||
===========
|
||||
* Linux is supported.
|
||||
|
||||
Version 2.1
|
||||
===========
|
||||
* Added the gifovly tool, which supports making a composite from several GIF
|
||||
images.
|
||||
* Used gifovly to implement a full-fledged pasteup program in shell. It's
|
||||
called gifcompose and lives in the util directory.
|
||||
* Added a copy of the GIF89 standard to the doc directory (gif89.txt);
|
||||
also a description of the preferred compression method (lzgif.txt).
|
||||
|
||||
Version 2.0
|
||||
===========
|
||||
With this version, development was taken over from Gershon Elber by Eric
|
||||
S. Raymond <esr@snark.thyrsus.com>. Note that I, esr, have pretty much
|
||||
adhered to Gershon's coding style, even though it's quite baroque and DOS-
|
||||
headed by my standards.
|
||||
|
||||
Library Improvements
|
||||
--------------------
|
||||
* New DGifSlurp() and EGifSpew() library entry points allow all GIF-bashing
|
||||
to be done in core on machines with sufficient memory. Writing code to
|
||||
slice'n'dice multiple GIFs in non-sequential ways is now much easier (send
|
||||
kudos and brickbats to esr, small unmarked bills preferred).
|
||||
* The interface has changed somewhat. Members in the GifFileType structure
|
||||
have been renamed and regrouped. This was required for support of the
|
||||
SavedImages member (which enables the new functions mentioned in 1). Also,
|
||||
there is a new data type for allocated color maps and routines to handle
|
||||
it conveniently.
|
||||
* Some minor bugs have been fixed. Most notably, the DGif code now correctly
|
||||
handles the possibility of more than one code block per extension record,
|
||||
as per the GIF spec. It's not clear, however, that anyone ever has or
|
||||
ever will use this feature for anything...
|
||||
|
||||
New Tools and Options
|
||||
---------------------
|
||||
* A brand new, ultra-spiffy tool `icon2gif' is included. It assembles named
|
||||
GIFs with editable text color map & icon raster representations to produce
|
||||
multi-image GIFs usable as graphical resource files. It can also dump most
|
||||
GIFs in the same text-only form it parses. This makes it easy to edit GIFs
|
||||
even if you don't have a graphics editor.
|
||||
* The gifclip utility supports a new `-c' (complement) option that allows you
|
||||
to perform an `inverse clip', removing horizontal or vertical bands from an
|
||||
image.
|
||||
* The gifclrmp utility supports a new `-t' switch for shuffling color index
|
||||
values.
|
||||
* A new tool `gifcolor' generates test pattern from colormap input.
|
||||
|
||||
New Documentation and Examples
|
||||
------------------------------
|
||||
* The documentation has been overhauled completely and translated out of the
|
||||
dialect spoken by the estimable Mr. Elber into something like standard
|
||||
English :-).
|
||||
* Two source code files gifspnge.c and giffiltr.c have been added to the
|
||||
util directory. These are GIF copiers that exercise the I/O routines,
|
||||
provided as skeletons for your applications. Read the comments in them
|
||||
for more info.
|
||||
* The util Makefile for UNIX has been improved. It now uses the cc/gcc -s
|
||||
option rather than strip(1). There are now separate install productions,
|
||||
so you can test new versions in util before installation for production
|
||||
(the top-level make script still does an install).
|
||||
|
||||
Version 1.2
|
||||
===========
|
||||
* GIFFIX - a new tool to attempt and fix broken GIF images. Currently fix
|
||||
images that has EOF prematurely by padding with the darkest color.
|
||||
* Make GIF2BGI display as much as it can considering the mem. avail.
|
||||
* Add -q flag to all tools for quite running scan line number mode.
|
||||
* Fix a (minor!?) bug in the GIF decoder when encountering code 4095.
|
||||
* New tools (RGB2GIF and GIF2RGB) to convert GIF to/from 24 bits RGB images.
|
||||
* New tool GIFROTAT to rotate a gif image by an arbitrary angle.
|
||||
* GifRSize was updated to resize by an arbitrary factor.
|
||||
|
||||
Version 1.1
|
||||
===========
|
||||
* GIF2BGI - a new utility to display GIF images using Borland's BGI drivers
|
||||
(if you have one...)
|
||||
* TEXT2GIF - Converts plain text into GIF images.
|
||||
* GIF2IRIS - SGI4D display program for GIF images.
|
||||
* GIF_LIB naming convension has been modified to make sure it has unique
|
||||
names (see gif_lib.h).
|
||||
* Support for SGI4D gl and X11 window grabbing has been added to the
|
||||
library. SGI4D input is quantizied into 8 bits.
|
||||
Also support for EGA/VGA devices has been added as well.
|
||||
see Dev2gif.c module.
|
||||
* Support for the new gif89a format has been added.
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
= GIFLIB =
|
||||
|
||||
This is the README file of GIFLIB, a library for manipulating GIF files.
|
||||
|
||||
Latest versions of GIFLIB are currently hosted at:
|
||||
http://sourceforge.net/projects/giflib
|
||||
|
||||
== Overview ==
|
||||
|
||||
GIF is a legacy format; we recommend against generating new images in
|
||||
it. For a cleaner, more extensible design with better color support
|
||||
and compression, look up PNG.
|
||||
|
||||
giflib provides code for reading GIF files and transforming them into
|
||||
RGB bitmaps, and for writing RGB bitmaps as GIF files.
|
||||
|
||||
The (permissive) open-source license is in the file COPYING.
|
||||
|
||||
You will find build instructions in build.adoc
|
||||
|
||||
You will find full documentation of the API in doc/ and on the
|
||||
project website.
|
||||
|
||||
Please report bugs to the bug tracker on sourceforge:
|
||||
|
||||
http://sourceforge.net/tracker/?group_id=102202
|
||||
|
||||
The project has a long and confusing history, described in history.adoc
|
||||
|
||||
The project to-do list is in TODO.
|
||||
|
||||
== Authors ==
|
||||
|
||||
Gershon Elber <gershon[AT]cs.technion.sc.il>
|
||||
original giflib code
|
||||
|
||||
Toshio Kuratomi <toshio[AT]tiki-lounge.com>
|
||||
uncompressed gif writing code
|
||||
former maintainer
|
||||
|
||||
Eric Raymond <esr[AT]snark.thyrsus.com>
|
||||
current as well as long time former maintainer of giflib code
|
||||
|
||||
There have been many other contributors; see the attributions in the
|
||||
version-control history to learn more.
|
||||
@@ -0,0 +1,11 @@
|
||||
[
|
||||
{
|
||||
"Name": "giflib",
|
||||
"License": "MIT",
|
||||
"License File": "COPYING",
|
||||
"Version Number": "5.2.1",
|
||||
"Owner": "jinbo8@huawei.com",
|
||||
"Upstream URL": "https://sourceforge.net/projects/giflib/files/giflib-5.2.1.tar.gz",
|
||||
"Description": "giflib is a library for reading and writing gif images. It is API and ABIcompatible with libungif which was in wide use while the LZW compression algorithm was patented."
|
||||
}
|
||||
]
|
||||
@@ -1,36 +0,0 @@
|
||||
# third_party_giflib
|
||||
|
||||
#### Description
|
||||
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
|
||||
|
||||
#### Software Architecture
|
||||
Software architecture description
|
||||
|
||||
#### Installation
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Instructions
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Contribution
|
||||
|
||||
1. Fork the repository
|
||||
2. Create Feat_xxx branch
|
||||
3. Commit your code
|
||||
4. Create Pull Request
|
||||
|
||||
|
||||
#### Gitee Feature
|
||||
|
||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
@@ -1,39 +0,0 @@
|
||||
# third_party_giflib
|
||||
|
||||
#### 介绍
|
||||
{**以下是 Gitee 平台说明,您可以替换此简介**
|
||||
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
|
||||
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
|
||||
|
||||
#### 软件架构
|
||||
软件架构说明
|
||||
|
||||
|
||||
#### 安装教程
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 使用说明
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 参与贡献
|
||||
|
||||
1. Fork 本仓库
|
||||
2. 新建 Feat_xxx 分支
|
||||
3. 提交代码
|
||||
4. 新建 Pull Request
|
||||
|
||||
|
||||
#### 特技
|
||||
|
||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
||||
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
@@ -0,0 +1,10 @@
|
||||
= GIFLIB TODO list =
|
||||
|
||||
There is a list of GIF test suites here:
|
||||
|
||||
https://stackoverflow.com/questions/4866093/test-suite-for-gif-containing-images-using-rarely-used-features
|
||||
|
||||
These break the format in quite a number of interesting ways. GIFLIB doesn't
|
||||
do as well as it could; I haven't found one that causes a core dump, yet, but
|
||||
some malformations that could be worked around are not yet.
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
= Build instructions =
|
||||
|
||||
== Building ==
|
||||
|
||||
Building this package from a distribution tarball should be as simple as
|
||||
running make. Install with "make install" as root.
|
||||
|
||||
You will need xmlto to build the derived forms of the documentation
|
||||
from the DocBook-XML sources. If you are going no modify the website,
|
||||
you will also need to have asciidoc and the ImageMagick convert(1)
|
||||
utility installed.
|
||||
|
||||
== Testing ==
|
||||
|
||||
You can run "make check" after the library and utilities have been built
|
||||
to see a regression test of the codebase. No output (other than
|
||||
the test header lines) is good news.
|
||||
|
||||
== Portability note ==
|
||||
|
||||
This codebase now assumes your compiler is C99-conformant. If it
|
||||
isn't, the most likely trouble spot is "#include <stdint.h>"; your
|
||||
compiler may be looking for "inttypes.h" instead. By test, the code
|
||||
is backward-conformant to C89 except that it uses bool/true/false.
|
||||
|
||||
One (minimal but sufficient) concession to Windows portability has been
|
||||
make; inclusion of <unistd.h> is conditional on _WIN32 not being
|
||||
defined by the compiler (if it is <io.h> is included
|
||||
instead). Requests to go any further out of the way to accommodate
|
||||
Microsoft's toolchains are unlikely be looked on favorably.
|
||||
|
||||
== Release Procedure ==
|
||||
|
||||
1. Check the SourceForge tracker for bugs and patches.
|
||||
|
||||
2. Bump the version number in gif_lib.h. Do "make version"
|
||||
to confirm that it looks sane when extracted to the Makefile.
|
||||
|
||||
3. Version-stamp the top entry in the NEWS file.
|
||||
|
||||
4. If you are changing major versions, sync the XBS-SourceForge-Folder
|
||||
attribute in the control file.
|
||||
|
||||
5. 'make dist' to make a tarball.
|
||||
|
||||
6. Tag the release in the repo.
|
||||
|
||||
7. Ship the release tarball.
|
||||
|
||||
The last three steps can be done with "make release" if you have shipper
|
||||
installed.
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# This is not a real Debian control file, though the syntax is compatible.
|
||||
# It's project metadata for the shipper tool
|
||||
|
||||
Package: giflib
|
||||
|
||||
Destinations: ~,sourceforge
|
||||
|
||||
Description: a library for rendering and generating GIF image files.
|
||||
This is the GIF service code in C used for over two decades by graphics
|
||||
applications, web browsers, game consoles, ATMs, and pretty much anything
|
||||
else that throws pixels on a display. Simple, stable, and bulletproof.
|
||||
|
||||
XBS-Web-Directory: doc/staging
|
||||
XBS-Logo: doc/staging/giflib-logo.gif
|
||||
XBS-SourceForge-Folder: giflib-5.x
|
||||
|
||||
XBS-VC-Tag-Template: %(version)s
|
||||
|
||||
#XBS-Project-Tags: GIF, graphics
|
||||
@@ -0,0 +1,13 @@
|
||||
This directory contains documentation on the API and tools.
|
||||
The most convenient way to view it is with a browser pointed
|
||||
at the project website, but...
|
||||
|
||||
An introduction to the package is in intro.xml
|
||||
|
||||
API documentation lives in gif_lib.xml
|
||||
|
||||
GIF standards documents can be found in the directory gifstandard/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
.SUFFIXES: .xml .html .txt .adoc .1
|
||||
|
||||
.xml.html:
|
||||
xmlto xhtml-nochunks $<
|
||||
|
||||
.xml.1:
|
||||
xmlto man $<
|
||||
|
||||
.xml.txt:
|
||||
xmlto txt $<
|
||||
|
||||
.adoc.html:
|
||||
asciidoc $<
|
||||
|
||||
all: allhtml manpages
|
||||
|
||||
# The distinction between XMLMAN and XMLINTERNAL is because
|
||||
# some pages shouldn't be installed as part of a binary package;
|
||||
# they're just for test-pattern generators.
|
||||
XMLMAN = \
|
||||
gif2rgb.xml \
|
||||
gifbuild.xml \
|
||||
gifclrmp.xml \
|
||||
gifecho.xml \
|
||||
giffix.xml \
|
||||
gifinto.xml \
|
||||
giflib.xml \
|
||||
giftext.xml \
|
||||
giftool.xml
|
||||
XMLINTERNAL = \
|
||||
gifbg.xml \
|
||||
gifcolor.xml \
|
||||
gifhisto.xml \
|
||||
gifwedge.xml
|
||||
XMLDOC = intro.xml gif_lib.xml
|
||||
XMLALL = $(XMLMAN) $(XMLINTERNAL) $(XMLDOC)
|
||||
|
||||
# Philosophical choice: the website gets the internal manual pages
|
||||
allhtml: $(XMLALL:.xml=.html) $(XMLINTERNAL:.xml=.html)
|
||||
|
||||
manpages: $(XMLMAN:.xml=.1) $(XMLINTERNAL:.xml=.1)
|
||||
|
||||
# Prepare the website directory to deliver an update.
|
||||
# ImageMagick and asciidoc are required.
|
||||
website: allhtml
|
||||
rm -fr staging; mkdir staging;
|
||||
cp -r $(XMLALL:.xml=.html) gifstandard whatsinagif staging
|
||||
cp index.html.in staging/index.html
|
||||
convert ../pic/gifgrid.gif -resize 50x50 staging/giflib-logo.gif
|
||||
asciidoc - <../history.adoc >staging/history.html
|
||||
@@ -0,0 +1,72 @@
|
||||
'\" t
|
||||
.\" Title: gif2rgb
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 2 May 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIF2RGB" "1" "2 May 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
gif2rgb \- convert images saved as GIF to 24\-bit RGB triplets
|
||||
.SH "SYNOPSIS"
|
||||
.HP \w'\fBgif2rgb\fR\ 'u
|
||||
\fBgif2rgb\fR [\-v] [\-1] [\-c\ \fIcolors\fR] [\-s\ \fIwidth\fR\ \fIheight\fR] [\-o\ \fIoutfile\fR] [\-h] [\fIgif\-file\fR]
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\-v
|
||||
.RS 4
|
||||
Verbose mode (show progress)\&. Enables printout of running scan lines\&.
|
||||
.RE
|
||||
.PP
|
||||
\-1
|
||||
.RS 4
|
||||
Only one file in the format of RGBRGB\&.\&.\&. triplets (Each of R, G,B is a byte) is being read or written\&. This file size is 3 * Width * Height\&. If stdin is used for input or stdout for output, this option is implicitly applied\&. The default (if not `\-1\*(Aq) is 3 files with the names OutFileName\&.R, OutFileName\&.G, OutFileName\&.B, each of which is Width * Height bytes\&.
|
||||
.RE
|
||||
.PP
|
||||
\-c colors
|
||||
.RS 4
|
||||
Specifies number of colors to use in RGB\-to\-GIF conversions, in bits per pixels, so \*(Aq\-c 8\*(Aq actually specifies 256 colors (maximum and default)\&.
|
||||
.RE
|
||||
.PP
|
||||
\-s width height
|
||||
.RS 4
|
||||
Sets RGB\-to\-GIF conversion mode and specifies the size of the image to read\&.
|
||||
.RE
|
||||
.PP
|
||||
\-o
|
||||
.RS 4
|
||||
specifies the name of the out file (see also `\-1\*(Aq above)\&.
|
||||
.RE
|
||||
.PP
|
||||
\-h
|
||||
.RS 4
|
||||
Print one line of command line help, similar to Usage above\&.
|
||||
.RE
|
||||
.PP
|
||||
By default, convert a GIF input file to RGB triplets\&. If \-s is specified, convert RGB input to a GIF\&.
|
||||
.PP
|
||||
If no input file is given, gif2rgb will try to read data from stdin\&.
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
Gershon Elber\&.
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>gif2rgb</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="gif2rgb.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>gif2rgb — convert images saved as GIF to 24-bit RGB triplets</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">gif2rgb</code> [-v] [-1] [-c <em class="replaceable"><code>colors</code></em>] [-s
|
||||
<em class="replaceable"><code>width</code></em>
|
||||
<em class="replaceable"><code>height</code></em>] [-o <em class="replaceable"><code>outfile</code></em>] [-h] [<em class="replaceable"><code>gif-file</code></em>]</p></div></div><div class="refsect1"><a id="idm27"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><p>Verbose mode (show progress).
|
||||
Enables printout of running scan lines.</p></dd><dt><span class="term">-1</span></dt><dd><p>Only one file in the format of RGBRGB... triplets (Each of R,
|
||||
G,B is a byte) is being read or written. This file size is 3 * Width
|
||||
* Height. If stdin is used for input or stdout for output, this option
|
||||
is implicitly applied. The default (if not `-1') is 3 files with the
|
||||
names OutFileName.R, OutFileName.G, OutFileName.B, each of which is
|
||||
Width * Height bytes.</p></dd><dt><span class="term">-c colors </span></dt><dd><p> Specifies number of colors to use in RGB-to-GIF conversions, in
|
||||
bits per pixels, so '-c 8' actually specifies 256 colors (maximum and
|
||||
default).</p></dd><dt><span class="term">-s width height</span></dt><dd><p> Sets RGB-to-GIF conversion mode and specifies the size of the image
|
||||
to read. </p></dd><dt><span class="term">-o</span></dt><dd><p> specifies the name of the out file (see also `-1' above).</p></dd><dt><span class="term">-h</span></dt><dd><p> Print one line of command line help, similar to Usage above.</p></dd></dl></div><p>By default, convert a GIF input file to RGB triplets. If -s is
|
||||
specified, convert RGB input to a GIF.</p><p>If no input file is given, gif2rgb will try to read data
|
||||
from stdin.</p></div><div class="refsect1"><a id="idm56"></a><h2>Author</h2><p>Gershon Elber.</p></div></div></body></html>
|
||||
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||
<refentry id='gif2rgb.1'>
|
||||
<refentryinfo><date>2 May 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>gif2rgb</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>gif2rgb</refname>
|
||||
<refpurpose>convert images saved as GIF to 24-bit RGB triplets</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>gif2rgb</command>
|
||||
<arg choice='opt'>-v</arg>
|
||||
<arg choice='opt'>-1</arg>
|
||||
<arg choice='opt'>-c <replaceable>colors</replaceable></arg>
|
||||
<arg choice='opt'>-s
|
||||
<replaceable>width</replaceable>
|
||||
<replaceable>height</replaceable></arg>
|
||||
<arg choice='opt'>-o <replaceable>outfile</replaceable></arg>
|
||||
<arg choice='opt'>-h</arg>
|
||||
<arg choice='opt'><replaceable>gif-file</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Options</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para>Verbose mode (show progress).
|
||||
Enables printout of running scan lines.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-1</term>
|
||||
<listitem>
|
||||
<para>Only one file in the format of RGBRGB... triplets (Each of R,
|
||||
G,B is a byte) is being read or written. This file size is 3 * Width
|
||||
* Height. If stdin is used for input or stdout for output, this option
|
||||
is implicitly applied. The default (if not `-1') is 3 files with the
|
||||
names OutFileName.R, OutFileName.G, OutFileName.B, each of which is
|
||||
Width * Height bytes.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-c colors </term>
|
||||
<listitem>
|
||||
<para> Specifies number of colors to use in RGB-to-GIF conversions, in
|
||||
bits per pixels, so '-c 8' actually specifies 256 colors (maximum and
|
||||
default).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-s width height</term>
|
||||
<listitem>
|
||||
<para> Sets RGB-to-GIF conversion mode and specifies the size of the image
|
||||
to read. </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-o</term>
|
||||
<listitem>
|
||||
<para> specifies the name of the out file (see also `-1' above).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-h</term>
|
||||
<listitem>
|
||||
<para> Print one line of command line help, similar to Usage above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>By default, convert a GIF input file to RGB triplets. If -s is
|
||||
specified, convert RGB input to a GIF.</para>
|
||||
|
||||
<para>If no input file is given, gif2rgb will try to read data
|
||||
from stdin.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Author</title>
|
||||
|
||||
<para>Gershon Elber.</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
@@ -0,0 +1,518 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>The GIFLIB Library</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="article"><div class="titlepage"><div><div><h2 class="title"><a id="idm1"></a>The GIFLIB Library</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Eric</span> <span class="othername">Steven</span> <span class="surname">Raymond</span></h3><div class="affiliation"><span class="orgname"><a class="ulink" href="http://catb.org/~esr/" target="_top">
|
||||
Thyrsus Enterprises</a><br /></span><div class="address"><p><br />
|
||||
<code class="email"><<a class="email" href="mailto:esr@thyrsus.com">esr@thyrsus.com</a>></code><br />
|
||||
</p></div></div></div></div><div><p class="copyright">Copyright © 2012 Eric S. Raymond</p></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="#idm16">Introduction</a></span></dt><dt><span class="sect1"><a href="#idm21">Credit and Blame</a></span></dt><dt><span class="sect1"><a href="#idm27">The GIF descriptor</a></span></dt><dt><span class="sect1"><a href="#idm55">Decoding (dgif_lib.c)</a></span></dt><dt><span class="sect1"><a href="#idm73">Encoding (egif_lib.c)</a></span></dt><dt><span class="sect1"><a href="#idm84">Color map handling and allocation routines</a></span></dt><dt><span class="sect1"><a href="#idm94">Graphics control extension handling</a></span></dt><dt><span class="sect1"><a href="#idm99">Error Handling (gif_err.c)</a></span></dt><dt><span class="sect1"><a href="#idm103">The GIF Utility Font</a></span></dt><dt><span class="sect1"><a href="#idm116">Error codes</a></span></dt><dd><dl><dt><span class="sect2"><a href="#idm119">Encoding errors</a></span></dt><dt><span class="sect2"><a href="#idm172">Decoding errors</a></span></dt></dl></dd><dt><span class="sect1"><a href="#idm240">Utility support library</a></span></dt><dd><dl><dt><span class="sect2"><a href="#idm243">Error Handling</a></span></dt><dt><span class="sect2"><a href="#idm247">Command Line Parsing</a></span></dt></dl></dd><dt><span class="sect1"><a href="#sequential">Sequential access</a></span></dt><dd><dl><dt><span class="sect2"><a href="#idm260">Sequential reading</a></span></dt><dt><span class="sect2"><a href="#idm319">Sequential writing</a></span></dt></dl></dd><dt><span class="sect1"><a href="#compatibility">Forward and Backward Compatibility</a></span></dt><dd><dl><dt><span class="sect2"><a href="#idm389">General behavior</a></span></dt><dt><span class="sect2"><a href="#idm399">In documented functions:</a></span></dt><dt><span class="sect2"><a href="#idm412">In undocumented functions:</a></span></dt><dt><span class="sect2"><a href="#idm419">Error handling:</a></span></dt></dl></dd><dt><span class="sect1"><a href="#idm428">Skeletons of GIF filters</a></span></dt><dt><span class="sect1"><a href="#idm433">Unimplemented features</a></span></dt></dl></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm16"></a>Introduction</h2></div></div></div><p>The Graphics Interchange Format(c) is the Copyright property of
|
||||
CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe
|
||||
Incorporated.</p><p>This document explains the GIF library code in directory `lib'. The
|
||||
code is collected into a service library which is used in all the utilities in
|
||||
`util'. It can be used in any application needs to read/write the GIF
|
||||
file format. This document does <span class="emphasis"><em>not</em></span> explain the GIF file
|
||||
format and assumes you know it, at least to the level of the GIF file
|
||||
structure.</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm21"></a>Credit and Blame</h2></div></div></div><p>Gershon wrote: "This library was written because I couldn't find
|
||||
anything similar and I wanted one. I was inspired by the RLE Utah tool kit,
|
||||
which I hoped to port to an IBM PC, but found it to be too machine specific,
|
||||
and its compression ratio too low. I compromised on the GIF format, but I am
|
||||
not sure how long 8 bits per pixel will be enough."</p><p>During his first spell of maintainership between 1989 and 1994, Eric
|
||||
S. Raymond (aka "ESR") ported the code to Unix, wrote the high-level
|
||||
DGIfSlurp()/EGifSpew() interface, rationalized the internal data
|
||||
structures, and did a lot of general cleanup and refactoring to
|
||||
improve the code quality.</p><p>Between 1994 and 2012 Toshio Kuratomi fixed various tool bugs,
|
||||
build-recipe problems and rare segfaults. He partially untangled the
|
||||
somewhat misdesigned extension-block handling in earlier versions.
|
||||
The core code was very stable during this period.</p><p>During his second spell of maintainership, ESR fixed the
|
||||
extension API, made the library re-entrant and thread-safe, wrote a
|
||||
regression-test suite, greatly improved the documentation, and
|
||||
discarded a lot of obsolete code.</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm27"></a>The GIF descriptor</h2></div></div></div><p>When a GIF file is opened, a GIF file descriptor is created which
|
||||
is a pointer to GifFileType structure as follows:</p><pre class="programlisting">
|
||||
typedef struct GifFileType {
|
||||
GifWord SWidth, SHeight; /* Size of virtual canvas */
|
||||
GifWord SColorResolution; /* How many colors can we generate? */
|
||||
GifWord SBackGroundColor; /* Background color for virtual canvas */
|
||||
GifByteType AspectByte; /* Used to compute pixel aspect ratio */
|
||||
ColorMapObject *SColorMap; /* Global colormap, NULL if nonexistent. */
|
||||
int ImageCount; /* Number of current image (both APIs) */
|
||||
GifImageDesc Image; /* Current image (low-level API) */
|
||||
SavedImage *SavedImages; /* Image sequence (high-level API) */
|
||||
int ExtensionBlockCount; /* Count extensions past last image */
|
||||
ExtensionBlock *ExtensionBlocks; /* Extensions past last image */
|
||||
int Error; /* Last error condition reported */
|
||||
void *UserData; /* hook to attach user data (TVT) */
|
||||
void *Private; /* Don't mess with this! */
|
||||
} GifFileType;
|
||||
</pre><p>This structure was copied from gif_lib.h - the header file for the GIF
|
||||
library. Any application program that uses the libgif.a library should
|
||||
include it. Members beginning with S refer to the GIF screen; others hold
|
||||
properties of the current image (a GIF file may have more than one image)
|
||||
or point to allocated store used by various routines.</p><p>The user almost never writes into this structure (exception: it
|
||||
may occasionally be useful to alter things in the SavedImages array and
|
||||
Trailing member), but can read any of these items at any time it is
|
||||
valid (Image information is invalid until the first image has been read;
|
||||
read; SavedImages information is valid only after a DGifSlurp() call).</p><p>As the library needs to keep its own internal data, a Private pointer
|
||||
to hidden data is included. Applications should ignore this.</p><p>The library allocates its own memory dynamically, on opening of files,
|
||||
and releases that once closed. The user is never required to allocate
|
||||
any memory for any of the functions of this library, and is almost never
|
||||
required to free them directly. The "almost" in the latter clause is because
|
||||
one manual free() call may be required on a failed file close; see the
|
||||
documentation of DGifClose() and EGifClose() for details.</p><p>Here is a module summary:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">egif_lib.c</span></dt><dd><p>Encoding routines, all prefixed with E.</p></dd><dt><span class="term">dgif_lib.c</span></dt><dd><p>Decoding routines, all prefixed with D.</p></dd><dt><span class="term">gifalloc.c</span></dt><dd><p>Routines for colormap handling and GIF record allocation.</p></dd><dt><span class="term">gif_font.c</span></dt><dd><p>The 8x8 font table for the GIF utility font.</p></dd></dl></div><p>The library includes a sixth file of hash-function code which is accessed
|
||||
internally only.</p><p>Most of the routines return GIF_ERROR (see gif_lib.h) if something
|
||||
went wrong, GIF_OK otherwise. After an error return, all routines that
|
||||
take a pointer-to-GifFileType argument set the Error member with a code that
|
||||
can be interpreted into an explanatory string with the function
|
||||
GifErrorString() in gif_err.c. (The exception to this is the
|
||||
DGifClose() and EGifClose() routines, which deallocate that structure
|
||||
and must therefore return any error code through a pointer argument.)</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm55"></a>Decoding (dgif_lib.c)</h2></div></div></div><p>The following functions are used to set up input from a GIF:</p><a id="DGifOpenFileName"></a><pre class="programlisting">
|
||||
GifFileType *DGifOpenFileName(char *GifFileName, int *ErrorCode)
|
||||
</pre><p>Open a new GIF file (in binary mode, if under Windows) using the
|
||||
given GifFileName, and read its Screen information.</p><p>If any error occurs, NULL is returned and ErrorCode is set (if
|
||||
non-NULL).</p><a id="DGifOpenFileHandle"></a><pre class="programlisting">
|
||||
GifFileType *DGifOpenFileHandle(int FileHandle, int *ErrorCode)
|
||||
</pre><p>Open a new GIF file using the given FileHandle, and read its Screen
|
||||
information.</p><p>If any error occurs, NULL is returned and ErrorCode is set (if
|
||||
non-NULL).</p><p>Once you have acquired a handle on a GIF, the high-level
|
||||
function</p><a id="DGifSlurp"></a><pre class="programlisting">
|
||||
int DGifSlurp(GifFileType)
|
||||
</pre><p>reads the rest of a complete (possibly multi-image) GIF file from the
|
||||
indicated file handle into in-core allocated structures. It returns
|
||||
GIF_OK on success, GIF_ERROR on failure; on failure, the Error member
|
||||
will be set.</p><p>Once you have done this, all image, raster, and extension-block
|
||||
data in the GIF is accessable in the SavedImages member (see the
|
||||
structures in gif_lib.h). When you have modified the image to taste,
|
||||
write it out with EGifSpew().</p><p>One detail that may not be clear from just looking at the
|
||||
structures is how extension blocks and sub-blocks are stored. Each
|
||||
ExtensionBlock structure represents an extension data block. Those
|
||||
with a zero function code represent continuation data blocks attached
|
||||
to previous blocks with nonzero function codes.</p><p>You can read from a GIF file through a function hook. Initialize
|
||||
with </p><a id="DGifOpen"></a><pre class="programlisting">
|
||||
GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *ErrorCode)
|
||||
</pre><p>and see the library header file for the type of InputFunc.</p><p>There is also a set of deprecated functions for sequential I/O,
|
||||
described in a later section.</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm73"></a>Encoding (egif_lib.c)</h2></div></div></div><p>The high-level function</p><a id="EGifSpew"></a><pre class="programlisting">
|
||||
int EGifSpew(GifFileType *GifFile)
|
||||
</pre><p>writes a complete (possibly multi-image) GIF file to the indicated file
|
||||
handle from in-core allocated structures created by a previous DGifSlurp()
|
||||
or equivalent operations. Its argument is a GIF file descriptor, which
|
||||
imnplicitly points to storage previously allocated by DGifSlurp().</p><p>The file is written with a GIF87 stamp unless it contains one of the four
|
||||
special extension blocks defined in GIF89, in which case it is written
|
||||
with a GIF89 stamp.</p><p>EGifSpew() finishes by closing the GIF (writing a termination
|
||||
record to it) and deallocating the associated storage.</p><p>You can write to a GIF file through a function hook. Initialize
|
||||
with </p><a id="EGifOpen"></a><pre class="programlisting">
|
||||
GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *ErrorCode)
|
||||
</pre><p>and see the library header file for the type of OutputFunc.</p><p>There is also a set of deprecated functions for sequential I/O,
|
||||
described in a later section.</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm84"></a>Color map handling and allocation routines</h2></div></div></div><a id="GifMakeMapObject"></a><pre class="programlisting">
|
||||
ColorMapObject *GifMakeMapObject(int ColorCount, GifColorType *ColorMap)
|
||||
</pre><p>Allocate storage for a color map object with the given number of
|
||||
RGB triplet slots. If the second argument is non-NULL, initialize
|
||||
the color table portion of the new map from it. Returns NULL if
|
||||
memory is exhausted or if the size is not a power of 2 <= 256.</p><a id="GifFreeMapObject"></a><pre class="programlisting">
|
||||
void GifFreeMapObject(ColorMapObject *Object)
|
||||
</pre><p>Free the storage occupied by a ColorMapObject that is no longer
|
||||
needed.</p><a id="GifUnionColorMap"></a><pre class="programlisting">
|
||||
ColorMapObject *GifUnionColorMap(
|
||||
ColorMapObject *ColorIn1, ColorMapObject *ColorIn2,
|
||||
GifPixelType ColorTransIn2[])
|
||||
</pre><p>Create the union of two given color maps and return it. If the result
|
||||
won't fit into 256 colors, NULL is returned, the allocated union
|
||||
otherwise. ColorIn1 is copied as it to ColorUnion, while colors from
|
||||
ColorIn2 are copied iff they didn't exist before. ColorTransIn2 maps
|
||||
the old ColorIn2 into ColorUnion color map table.</p><a id="GifAttachImage"></a><pre class="programlisting">
|
||||
SavedImage *GifAttachImage(GifFileType *GifFile)
|
||||
</pre><p>Add an image block to the SavedImages array. The image block is
|
||||
initially zeroed out. This image block will be seen by any following
|
||||
EGifSpew() calls.</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm94"></a>Graphics control extension handling</h2></div></div></div><p>GIF89 added a graphics control extension block, but versions
|
||||
of GIFLIB before 5.0 weren't much help in reading or modifying them.
|
||||
This lack has been remedied with the following structure and functions:</p><pre class="programlisting">
|
||||
typedef struct GraphicsControlBlock {
|
||||
int DisposalMode;
|
||||
#define DISPOSAL_UNSPECIFIED 0 /* No disposal specified. */
|
||||
#define DISPOSE_DO_NOT 1 /* Leave image in place */
|
||||
#define DISPOSE_BACKGROUND 2 /* Set area too background color */
|
||||
#define DISPOSE_PREVIOUS 3 /* Restore to previous content */
|
||||
bool UserInputFlag; /* User confirmation required before disposal */
|
||||
int DelayTime; /* pre-display delay in 0.01sec units */
|
||||
int TransparentColor; /* Palette index for transparency, -1 if none */
|
||||
#define NO_TRANSPARENT_COLOR -1
|
||||
} GraphicsControlBlock;
|
||||
|
||||
int DGifSavedExtensionToGCB(GifFileType *GifFile,
|
||||
int ImageIndex,
|
||||
GraphicsControlBlock *GCB);
|
||||
int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB,
|
||||
GifFileType *GifFile,
|
||||
int ImageIndex);
|
||||
</pre><p>With these functions you can extract the data from a graphics
|
||||
control extension associated with a saved image into a
|
||||
GraphicsControlBlock, modify it, and write it back out. Note that if
|
||||
the specified saved image doesn't have a graphics control extension,
|
||||
DGifSavedExtensionToGCB() will fill the GCB with default values and
|
||||
return GIF_ERROR (which can be ignored); EGifGCBToSavedExtension()
|
||||
will create a new leading extension block.</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm99"></a>Error Handling (gif_err.c)</h2></div></div></div><pre class="programlisting">
|
||||
int GifErrorString(int ErrCode)
|
||||
</pre><p>Returns a sting describing the specified GIFLIB error code.
|
||||
Return NULL if the argument is not a valid error code.</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm103"></a>The GIF Utility Font</h2></div></div></div><p>The 8x8 utility font used in gifecho and gifcolor lives in the library
|
||||
module gif_font.c, in a table called GifAsciiTable. The library header file
|
||||
includes suitable externs and defines.</p><p>The GIF utility font support includes entry points for drawing legends
|
||||
on in-core images, drawing boxes and rectangles, and boxing text.
|
||||
These entry points are as follows:</p><a id="GifDrawText"></a><pre class="programlisting">
|
||||
void GifDrawText8x8(
|
||||
SavedImage *Image,
|
||||
const int x, const int y,
|
||||
const char *legend,
|
||||
const int color)
|
||||
</pre><p>Draw text using the 8x8 utility font on the saved image. Upper
|
||||
left corner of the text is at image pixel (x, y). Use the specified
|
||||
color index.</p><a id="GifDrawBox"></a><pre class="programlisting">
|
||||
void GifDrawBox(SavedImage *Image,
|
||||
const int x, const int y,
|
||||
const int w, const int h,
|
||||
const int color)
|
||||
</pre><p>Draw a box on the saved image. Upper left corner of the box is at
|
||||
image pixels (x, y), width is w, height is h. Use the specified color
|
||||
index.</p><a id="GifDrawRectangle"></a><pre class="programlisting">
|
||||
void GifDrawRectangle(SavedImage *Image,
|
||||
const int x, const int y,
|
||||
const int w, const int h,
|
||||
const int color)
|
||||
</pre><p>Draw a (filled) rectangle on the saved image. Upper left corner of
|
||||
the box is at image pixels (x, y), width is w, height is h. Use the
|
||||
specified color index.</p><a id="GifDrawBoxedText"></a><pre class="programlisting">
|
||||
void GifDrawBoxedText8x8(SavedImage *Image,
|
||||
const int x, const int y,
|
||||
const char *legend,
|
||||
const int border,
|
||||
const int bg, const int fg)
|
||||
</pre><p>Draw text on a filled rectangle. The rectangle will be sized to fit
|
||||
the text, with upper left hand corner at (x, y) on the saved image.
|
||||
The `border' argument specifies a pixel margin around the text. The
|
||||
`bg' argument is the color table index to fill the rectangle with;
|
||||
`fg' is the color table index to draw the text with.</p><p>This function interprets some characters in the legend string
|
||||
specially. A tab (\t) is interpreted as a command to center the
|
||||
following text in the box. A carriage return (\r) is interpreted
|
||||
as a request for a line break.</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm116"></a>Error codes</h2></div></div></div><p>Errors as reported from the GIFLIB library are divided to two major
|
||||
categories: the encoder (errors prefixed by E_GIF_ERR), and the
|
||||
decoder (errors prefixed by D_GIF_ERR). This document explains them
|
||||
briefly.</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm119"></a>Encoding errors</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorname">E_GIF_ERR_OPEN_FAILED</span></span></dt><dd><p>Message printed using PrintGifError: "Failed to open given file"
|
||||
IO error result when attempt to open the given GIF file.</p></dd><dt><span class="term"><span class="errorname">E_GIF_ERR_WRITE_FAILED</span></span></dt><dd><p>Message printed using PrintGifError: "Failed to Write to given file"
|
||||
IO error result when attempt to write to the given GIF file.</p></dd><dt><span class="term"><span class="errorname">E_GIF_ERR_HAS_SCRN_DSCR</span></span></dt><dd><p>Message printed using PrintGifError: "Screen Descriptor
|
||||
already been set" Attempt to write second screen descriptor to same
|
||||
GIF file. GIF file should have exactly one screen descriptor which
|
||||
should be set directly after the file is opened.</p></dd><dt><span class="term"><span class="errorname">E_GIF_ERR_HAS_IMAG_DSCR</span></span></dt><dd><p>Message printed using PrintGifError: "Image Descriptor is still active"
|
||||
Image descriptor should be sent before and image dump, and no second
|
||||
image descriptor should be sent before current image dump ended. This error
|
||||
occurred probably because current image was not complete.</p></dd><dt><span class="term"><span class="errorname">E_GIF_ERR_NO_COLOR_MAP</span></span></dt><dd><p>Message printed using PrintGifError: "Neither Global Nor
|
||||
Local color map" An image must have either global (screen) or local
|
||||
(image) color map. Neither were given in this case.</p></dd><dt><span class="term"><span class="errorname">E_GIF_ERR_DATA_TOO_BIG</span></span></dt><dd><p>Message printed using PrintGifError: "#Pixels bigger than
|
||||
Width * Height" The number of pixels dumped for this image is
|
||||
bigger than specified by image Height times image Width.</p></dd><dt><span class="term"><span class="errorname">E_GIF_ERR_NOT_ENOUGH_MEM</span></span></dt><dd><p>Message printed using PrintGifError: "Fail to allocate
|
||||
required memory" Once an attemp is made to open GIF file, special
|
||||
structures are allocated to hold internal data for it. If
|
||||
allocation fails this error is returned.</p></dd><dt><span class="term"><span class="errorname">E_GIF_ERR_DISK_IS_FULL</span></span></dt><dd><p>Message printed using PrintGifError: "Write failed (disk full?)"
|
||||
Writing encoded data failed.</p></dd><dt><span class="term"><span class="errorname">E_GIF_ERR_CLOSE_FAILED</span></span></dt><dd><p>Message printed using PrintGifError: "Failed to close given file"
|
||||
Closing file failed.</p></dd><dt><span class="term"><span class="errorname"> E_GIF_ERR_NOT_WRITEABLE</span></span></dt><dd><p>Message printed using PrintGifError: "Given file was not
|
||||
opened for write" GIF files can be opened both for read (DGIF part
|
||||
of library) and write (EGIF part of library). This error occurs
|
||||
when a file is opened for read (using DGIF) is given to one of the
|
||||
encoding (EGIF) routines.</p></dd></dl></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm172"></a>Decoding errors</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorname">D_GIF_ERR_OPEN_FAILED</span></span></dt><dd><p>Message printed using PrintGifError: "Failed to open given file"
|
||||
IO error result when attempt to open the given GIF file.</p></dd><dt><span class="term"><span class="errorname">D_GIF_ERR_READ_FAILED</span></span></dt><dd><p>Message printed using PrintGifError: "Failed to read from given file"
|
||||
IO error result when attempt to write to the given GIF file.</p></dd><dt><span class="term"><span class="errorname">D_GIF_ERR_NOT_GIF_FILE</span></span></dt><dd><p>Message printed using PrintGifError: "Data is not a GIF file"
|
||||
GIF files should have special stamp identifies them as such, If that stamp
|
||||
is not found, this error is issued.</p></dd><dt><span class="term"><span class="errorname">D_GIF_ERR_NO_SCRN_DSCR</span></span></dt><dd><p>Message printed using PrintGifError: "No screen descriptor detected"
|
||||
Each GIF file should have screen descriptor in its header. This error will
|
||||
be generated if no such descriptor was found.</p></dd><dt><span class="term"><span class="errorname">D_GIF_ERR_NO_IMAG_DSCR</span></span></dt><dd><p>Message printed using PrintGifError: "No image descriptor detected"
|
||||
Each image should have image descriptor in its header. This error will
|
||||
be generated if no such descriptor was found.</p></dd><dt><span class="term"><span class="errorname">D_GIF_ERR_NO_COLOR_MAP</span></span></dt><dd><p>Message printed using PrintGifError: "Neither global nor
|
||||
local color map" An image must have either global (screen) or local
|
||||
(image) color map. Neither were given in this case.</p></dd><dt><span class="term"><span class="errorname">D_GIF_ERR_WRONG_RECORD</span></span></dt><dd><p>Message printed using PrintGifError: "Wrong record type detected"
|
||||
Each record in a GIF file has a special identifier in its header. If the
|
||||
record has an unrecognized identifier, this error is generated.</p></dd><dt><span class="term"><span class="errorname">D_GIF_ERR_DATA_TOO_BIG</span></span></dt><dd><p>Message printed using PrintGifError: "Number of pixels bigger than
|
||||
width * height" The number of pixels dumped for this image is
|
||||
bigger than specified by image Height times image Width.</p></dd><dt><span class="term"><span class="errorname">D_GIF_ERR_NOT_ENOUGH_MEM</span></span></dt><dd><p>Message printed using PrintGifError: "Failed to allocate
|
||||
required memory" Once an attemp is made to open GIF file, special
|
||||
structures are allocated to hold internal data for it. If
|
||||
allocation fails this error is returned.</p></dd><dt><span class="term"><span class="errorname">D_GIF_ERR_CLOSE_FAILED</span></span></dt><dd><p>Message printed using PrintGifError: "Failed to close given file"
|
||||
Closing file failed.</p></dd><dt><span class="term"><span class="errorname">D_GIF_ERR_NOT_READABLE</span></span></dt><dd><p>Message printed using PrintGifError: "Given file was not
|
||||
opened for read" GIF files can be opened both for read (DGIF part
|
||||
of library) and write (EGIF part of library). This error occurs
|
||||
when a file is opened for write (using EGIF) is given to one of the
|
||||
decoding (DGIF) routines.</p></dd><dt><span class="term"><span class="errorname">D_GIF_ERR_IMAGE_DEFECT</span></span></dt><dd><p>Message printed using PrintGifError: "Image is defective,
|
||||
decoding aborted" This error is generated, once the decoding failed
|
||||
- probably image is defect.</p></dd><dt><span class="term"><span class="errorname">D_GIF_ERR_EOF_TOO_SOON</span></span></dt><dd><p>Message printed using PrintGifError: "Image EOF detected,
|
||||
before image complete" This error is generated once EOF errorname
|
||||
is detected in encoded image before all the pixels (Width *
|
||||
Height) has be decoded.</p></dd></dl></div></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm240"></a>Utility support library</h2></div></div></div><p>These functions are not part of the core GIF library. They are part
|
||||
of the getarg library that supports the utilities.</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm243"></a>Error Handling</h3></div></div></div><a id="PrintGifError"></a><pre class="programlisting">
|
||||
void PrintGifError(void)
|
||||
</pre><p>Print a one-line diagnostic on the last giflib error to stderr.</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm247"></a>Command Line Parsing</h3></div></div></div><a id="GAGetArgs"></a><pre class="programlisting">
|
||||
bool GAGetArgs(int argc, char **argv, char *CtrlStr, ...)
|
||||
</pre><p>Main routine of this module. Given argc & argv as received by
|
||||
the main procedure, the command line CtrlStr, and the addresses of
|
||||
all parameters, parse the command line, and update the parameters.</p><p>The CtrlStr defines what types of variables should follow. Look at the
|
||||
beginning of getarg.c for exact usage.</p><p>Returns false if successful, returns true on failure.</p><a id="GAPrintErrMsg"></a><pre class="programlisting">
|
||||
void GAPrintErrMsg(int Error)
|
||||
</pre><p>If an error occurred in GAGetARgs, this routine may be used to print
|
||||
one line diagnostic to stderr.</p><a id="GAPrintHowTo"></a><pre class="programlisting">
|
||||
void GAPrintHowTo(char *CtrlStr)
|
||||
</pre><p>Given the same CtrlStr as for GAGetArgs, can be used to print a one line
|
||||
'how to use'. </p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sequential"></a>Sequential access</h2></div></div></div><p>If you are handling large images on an extremely memory-limited
|
||||
machine, you may need to use the following functions for sequential
|
||||
read and write. It's better to avoid them and use the simpler
|
||||
DGifSlurp()/EGifSpew() interface.</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm260"></a>Sequential reading</h3></div></div></div><a id="DGifGetScreenDesc"></a><pre class="programlisting">
|
||||
int DGifGetScreenDesc(GifFileType *GifFile)
|
||||
</pre><p>Reads the screen information into the GifFile structure. Note this
|
||||
routine is automatically called once a file is opened, and therefore
|
||||
usually need not be called explicitly.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="DGifGetRecordType"></a><pre class="programlisting">
|
||||
int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType)
|
||||
</pre><p>As the GIF file can have different records in arbitrary order, this
|
||||
routine should be called once the file was open to detect the next
|
||||
record type, and act upon it. It can return these types in GifType:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">1. UndefinedRecordType </span></dt><dd><p>something is wrong!</p></dd><dt><span class="term">2. ScreenDescRecordType </span></dt><dd><p>screen information. As the screen info is automatically read in when the file is open, this should not happen.</p></dd><dt><span class="term">3. ImageDescRecordType </span></dt><dd><p> next record is an image descriptor.</p></dd><dt><span class="term">4. ExtensionRecordType</span></dt><dd><p> next record is extension block.</p></dd><dt><span class="term">5. TrailerRecordType</span></dt><dd><p>last record reached, can close the file.</p></dd></dl></div><p>The first two types can usually be ignored. The function
|
||||
returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="DGifGetImageDesc"></a><pre class="programlisting">
|
||||
int DGifGetImageDesc(GifFileType *GifFile)
|
||||
</pre><p>Reads image information into the GifFile structure.
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="DGifGetLine"></a><pre class="programlisting">
|
||||
int DGifGetLine(GifFileType *GifFile, PixelType *GifLine, int GifLineLen)
|
||||
</pre><p>Load a block of pixels from the GIF file. The line can be
|
||||
of any length. More than that, this routine may be interleaved with
|
||||
DGifGetPixel until all pixels have been read.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><pre class="programlisting">
|
||||
int DGifGetPixel(GifFileType *GifFile, PixelType GifPixel)
|
||||
</pre><p>Loads one pixel from the GIF file. This routine may be interleaved
|
||||
with <a class="link" href="#DGifGetLine">DGifGetLine()</a>, until all pixels are
|
||||
read. Because of the overhead per each call, use of this routine is
|
||||
not recommended.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><pre class="programlisting">
|
||||
int DGifGetExtension(
|
||||
GifFileType *GifFile,
|
||||
int *GifExtCode,
|
||||
ByteType **GifExtension)
|
||||
</pre><p>Loads an extension block from the GIF file. Extension blocks
|
||||
are optional in GIF files. This routine should be followed by
|
||||
<a class="link" href="#DGifGetExtensionNext">DGifGetExtensionNext</a>.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><p><a id="DGifGetExtensionNext"></a></p><pre class="programlisting">
|
||||
int DGifGetExtensionNext(GifFileType *GifFile, ByteType **GifExtension)
|
||||
</pre><p>
|
||||
|
||||
As extensions may contain more than one block, use this routine to
|
||||
continue after DGifGetExtension, until *GifExtension is NULL.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><pre class="programlisting">
|
||||
int DGifGetCode(
|
||||
GifFileType *GifFile,
|
||||
int *GifCodeSize, ByteType **GifCodeBlock)
|
||||
</pre><p>It sometimes may be desired to read the compressed code as is
|
||||
without decoding it. This routine does exactly that (with
|
||||
DGifGetCodeNext), and can be used instead of DGifGetLine.</p><p>This compressed code information can be written out using the
|
||||
EGifPutCode/EGifPutCodeNext sequence (see gifpos.c for example).
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="DGifGetCodeNext"></a><pre class="programlisting">
|
||||
int DGifGetCodeNext(GifFileType *GifFile, ByteType **GifCodeBlock)
|
||||
</pre><p>See DGifGetCode above.</p><a id="DGifGetLZCodes"></a><pre class="programlisting">
|
||||
int DGifGetLZCodes(GifFileType *GifFile, int *GifCode)
|
||||
</pre><p>This routine can be called instead of DGifGetLine/DGifGetPixel or
|
||||
DGifGetCode/DGifGetCodeNext to get the 12 bits LZ codes of the images.
|
||||
It will be used mainly for debugging purposes (see GifText.c for
|
||||
example).</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="DGifCloseFile"></a><pre class="programlisting">
|
||||
int DGifCloseFile(GifFileType *GifFile, int *ErrorCode)
|
||||
</pre><p>Write a termination block to the GIF, close the GIF file and
|
||||
free all memory allocated for managing it. GifFile should not be used after
|
||||
this routine has been called.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise. When
|
||||
GIF_ERROR is returned, the diagnostic error code is left in ErrorCode.
|
||||
The GifFile structure is unconditionally freed.</p><p>(Note: In versions before 5.1.0, the ErrorCode argument was
|
||||
absent and the GifFile structure was not freed so that the
|
||||
diagnostic error code will remain accessible in GifFile->Error.
|
||||
This behavior was changed because it caused problems for the
|
||||
implementation of library wrappers in dynamic languages.)</p><a id="DGetGifVersion"></a><pre class="programlisting">
|
||||
const char * DGifGetGifVersion(GifFileType *GifFile)
|
||||
</pre><p>Get the GIF version collected during sequential read. This is
|
||||
handy for sequential API users who want to set an encoder's version
|
||||
from a decoder (e.g. for gif resizing). For the all-at-once users this
|
||||
isn't necessary because gif encoder inspects all the extension blocks,
|
||||
but sequential users do not have that luxury.</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm319"></a>Sequential writing</h3></div></div></div><p>If you are handling large images on a memory-limited machine, you may need
|
||||
to use the following functions for sequential write.</p><a id="EGifOpenFileName"></a><pre class="programlisting">
|
||||
GifFileType *EGifOpenFileName(char *GifFileName, bool GifTestExistance, int *ErrorCode)
|
||||
</pre><p>Open a new GIF file using the given GifFileName (in binary mode,
|
||||
if under Windows). If GifTestExistance is TRUE, and file exists, the
|
||||
file is not destroyed, and NULL returned.</p><p>If any error occurs, NULL is returned and the ErrorCode is set.</p><a id="EGifOpenFileHandle"></a><pre class="programlisting">
|
||||
GifFileType *EGifOpenFileHandle(int GifFileHandle, int *ErrorCode)
|
||||
</pre><p>Open a new GIF file using the given GifFileHandle.</p><p>If any error occurs, NULL is returned and ErrorCode is set.</p><p>The file is opened in binary mode, and its buffer size is set to
|
||||
FILE_BUFFER_SIZE bytes.</p><pre class="programlisting">
|
||||
char *EGifGetGifVersion(GifFileType *GifFile)
|
||||
</pre><p>That version computation is available through this function.</p><a id="EGifSetGifVersion"></a><pre class="programlisting">
|
||||
void EGifSetGifVersion(GifFileType *GifFile, bool gif89)
|
||||
</pre><p>Set the GIF type, to GIF89 if the argument is true and GIF87 if
|
||||
it is false. The default type is GIF87. This function may be called
|
||||
aftert the GifFile record is allocated but before
|
||||
EGifPutScreenDesc().</p><pre class="programlisting">
|
||||
int EGifPutScreenDesc(GifFileType *GifFile,
|
||||
const int GifWidth, const GifHeight,
|
||||
const int GifColorRes, const int GifBackGround,
|
||||
ColorMapObject *GifColorMap)
|
||||
</pre><p>Update the GifFile Screen parameters, in GifFile structure and in
|
||||
the real file. If error occurs, returns GIF_ERROR (see gif_lib.h),
|
||||
otherwise GIF_OK.</p><p>This routine should be called immediately after the GIF file was
|
||||
opened.</p><pre class="programlisting">
|
||||
int EGifPutImageDesc(GifFileType *GifFile,
|
||||
const int GifLeft, const int GifTop,
|
||||
const int GifWidth, const GifHeight,
|
||||
const bool GifInterlace,
|
||||
ColorMapObject *GifColorMap)
|
||||
</pre><p>Update GifFile Image parameters, in GifFile structure and in the real
|
||||
file. if error occurs returns GIF_ERROR (see gif_lib.h), otherwise
|
||||
GIF_OK.</p><p>This routine should be called each time a new image must be
|
||||
dumped to the file.</p><a id="EGifPutLine"></a><pre class="programlisting">
|
||||
int EGifPutLine(GifFileType *GifFile, PixelType *GifLine, int GifLineLen)
|
||||
</pre><p>Dumps a block of pixels out to the GIF file. The slab can be of
|
||||
any length. More than that, this routine may be interleaved with
|
||||
<a class="link" href="#EGifPutPixel">EGifPutPixel()</a>, until all pixels
|
||||
have been sent.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="EGifPutPixel"></a><pre class="programlisting">
|
||||
int EGifPutPixel(GifFileType *GifFile, const PixelType GifPixel)
|
||||
</pre><p>Dumps one pixel to the GIF file. This routine may be interleaved with
|
||||
<a class="link" href="#EGifPutLine">EGifPutLine()</a>, until all pixels were sent.
|
||||
Because of the overhead for each call, use of this routine is not
|
||||
recommended.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="EGifPutComment"></a><pre class="programlisting">
|
||||
int EGifPutComment(GifFileType *GifFile, char *GifComment)
|
||||
</pre><p>Uses extension GIF records to save a string as a comment is the file.
|
||||
The extension code is 'C' (for Comment).</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="EGifPutExtension"></a><pre class="programlisting">
|
||||
int EGifPutExtension(
|
||||
GifFileType *GifFile,
|
||||
const int GifExtCode,
|
||||
const int GifExtLen,
|
||||
void *GifExtension)
|
||||
</pre><p>Dumps the given extension block into the GIF file. Extension blocks
|
||||
are optional in GIF file. Extension blocks of more than 255 bytes or
|
||||
more than one block are not supported in this function. Please use
|
||||
EGifPutExtensionFirst, EGifPutExtensionBlock, and EGifPutExtensionTrailer
|
||||
if your extension blocks may fall into this category.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="EGifPutExtensionLeader"></a><pre class="programlisting">
|
||||
int EGifPutExtensionLeader(
|
||||
GifFileType * GifFile,
|
||||
const int GifExtCode)
|
||||
</pre><p>Dumps the beginning of a GIF extension block to a GIF file.
|
||||
Extension blocks are optional in GIF files. This function outputs the
|
||||
type code information necessary for a GIF extension block.</p><p>Further blocks of the GIF Extension should be dumped using
|
||||
EGifPutExtensionBlock. When finished with this extension block,
|
||||
EGifPutExtensionTrailer should be called to output the block termination.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="EGifPutExtensionBlock"></a><pre class="programlisting">
|
||||
int EGifPutExtensionBlock(
|
||||
GifFileType * GifFile,
|
||||
const int GifExtLen,
|
||||
const VoidPtr GifExtension)
|
||||
</pre><p>Dumps a subblock of a GIF extension to a GIF File; should be
|
||||
used only following an initializing call to EGifPutExtensionLeader().
|
||||
Extension blocks are optional in GIF files. This function will write
|
||||
the Extension Data in GifExtension to the file as a subblock of the
|
||||
preceding Extension Block. Repeat calling of this function until all
|
||||
data subblocks have been output.</p><p>Note that EGifPutExtensionLeader needs to be called before any
|
||||
calls to this function. EGifPutExtensionTrailer should be called to
|
||||
finish the Extension block after all data subblocks have been
|
||||
output.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="EGifPutExtensionTrailer"></a><pre class="programlisting">
|
||||
int EGifPutExtensionTrailer(
|
||||
GifFileType * GifFile,
|
||||
const VoidPtr GifExtension)
|
||||
</pre><p>Dumps the GIF extension block terminator to a GIF File to end
|
||||
the current Extension block.</p><p>Note that a call to EGifPutExtensionLeader is needed to open the GIF
|
||||
Extension Block prior to calling this function.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="EGifPutCode"></a><pre class="programlisting">
|
||||
int EGifPutCode(
|
||||
GifFileType *GifFile,
|
||||
int *GifCodeSize,
|
||||
ByteType **GifCodeBlock)
|
||||
</pre><p>It sometimes may be desired to write the compressed code as is
|
||||
without decoding it. For example a filter for a GIF file that change
|
||||
only screen size (GifPos), does not need the exact pixel values.
|
||||
Piping out the compressed image as is makes this process much
|
||||
faster.</p><p>This routine does exactly that (with EGifPutCodeNext), and can be
|
||||
used instead of EGifPutLine. You'll usually use this with the
|
||||
DGifGetCode/DgifGetCodeNext routines, which reads the compressed
|
||||
code, while EGifPutCode/EGifPutCodeNext write it out. See gifpos.c
|
||||
for example.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</p><a id="EGifPutCodeNext"></a><pre class="programlisting">
|
||||
int EGifPutCodeNext(GifFileType *GifFile, ByteType **GifCodeBlock)
|
||||
</pre><p>See EGifPutCode above.</p><a id="EGifCloseFile"></a><pre class="programlisting">
|
||||
int EGifCloseFile(GifFileType *GifFile)
|
||||
</pre><p>Write a termination block to the GIF, close the GIF file, and
|
||||
free all memory allocated for managing it. GifFile should not be used
|
||||
after this routine has been called.</p><p>Returns GIF_ERROR if something went wrong, GIF_OK otherwise. When
|
||||
GIF_ERROR is returned, the diagnostic error code is left in ErrorCode.
|
||||
The GifFile structure is unconditionally freed.</p><p>(Note: In versions before 5.1.0, the ErrorCode argument was
|
||||
absent and the GifFile structure was not freed so that the
|
||||
diagnostic error code will remain accessible in GifFile->Error.
|
||||
This behavior was changed because it caused problems for the
|
||||
implementation of library wrappers in dynamic languages.)</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="compatibility"></a>Forward and Backward Compatibility</h2></div></div></div><p>Except for some details of extension-block handling and the addition
|
||||
of read/write function hooks, the DGifSlurp()/EGifSpew() interface has
|
||||
been stable since 1990. It is expected to remain so.</p><p>However, the signatures of the file-opener functions were changed in 5.0
|
||||
in order to make the library fully reentrant and thread-safe - earlier library
|
||||
versions did not feature the final pointer-to-error-code argument in
|
||||
DGifOpen() and friends. For the same reason, the static storage queried by
|
||||
GifLastError() in older versions is gone, and that function abolished.</p><p>The library header contains some version #defines you can use if you
|
||||
need to condition your code so it can compile with different library
|
||||
versions</p><p>Versions up to 4.1.6 defined a GIF_LIB_VERSION macro that was
|
||||
string-valued with a tricky format to parse. This macro has been
|
||||
retired.</p><p>Versions after 4.1.6 define integer-valued GIFLIB_MAJOR, GIFLIB_MINOR,
|
||||
and GIFLIB_RELEASE macros for the three components of the version. See the
|
||||
NEWS file in the GIFLIB distribution to track API changes.</p><p>The following functions are entirely new:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>New functions DGifSavedExtensionToGCB() and
|
||||
EGifGCBToSavedExtension() make it easy to read and edit GIF89 graphics
|
||||
control blocks in saved images.</p></li><li class="listitem"><p>The new function DGifGetGifVersion() is convenient
|
||||
for people doing sequential reads.</p></li></ul></div><p>A few changes in behavior were introduced in 5.0:</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm389"></a>General behavior</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>The library is now fully re-entrant and
|
||||
thread-safe.</p></li></ul></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> All functions exported by this library now have DGif,
|
||||
EGif, or Gif as a name prefix.</p></li><li class="listitem"><p>The default GIF version to write is now computed at
|
||||
write time from the types of an image's extension blocks. (Formerly
|
||||
EGifSpew() behaved this way, but the sequential-writing code didn't.)
|
||||
The result of this computation is available through the new function
|
||||
EGifGetGifVersion().</p></li></ul></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm399"></a>In documented functions:</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GIF file openers and closers - DGifOpenFileName(),
|
||||
DGifOpenFileHandle(), DGifOpen(), DGifClose(), EGifOpenFileName(),
|
||||
EGifOpenFileHandle(), EGifOpen(), and EGifClose() - all now take a
|
||||
final integer address argument. If non-null, this is used to pass
|
||||
back an error code when the function returns NULL.</p></li><li class="listitem"><p>EGifSlurp() and EGifSpew() read and write
|
||||
extension blocks trailing after the last image, handle interlaced
|
||||
images properly.</p></li><li class="listitem"><p>EGifPutExtensionFirst() has been replaced by
|
||||
EGifPutExtensionLeader(); the difference is the new function doesn't
|
||||
take an optional block, it just writes a block
|
||||
leader.</p></li><li class="listitem"><p>EGifPutExtensionNext() has been replaced by
|
||||
EGifPutExtensionBlock(); the difference is that the new function does
|
||||
not take and then discard a function code argument.</p></li><li class="listitem"><p>EGifPutExtensionLast() has been replaced by
|
||||
EGifPutExtensionTrailer(); all it does is write the terminator
|
||||
block. Split your old EGifPutExtensionLast() calls into
|
||||
EGifPutExtensionBlock() followed by
|
||||
EGifPutExtensionTrailer().</p></li></ul></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm412"></a>In undocumented functions:</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Some undocumented functions have been renamed.
|
||||
AddExtensionBlock() is now GifAddExtensionBlock(), and takes an additional
|
||||
function code argument. ApplyTranslation() is now GifApplyTranslation();
|
||||
FreeExtension() has become GifFreeExtensions() and takes a different argument
|
||||
type; MakeSavedImage() is now GifMakeSavedImage(), FreeSavedImages() is
|
||||
now GifFreeSavedImages(), and BitSize() is now GifBitSize().</p></li><li class="listitem"><p>Three documented functions - MakeMapObject(),
|
||||
FreeMapObject(), and UnionColorMap() - have been renamed to
|
||||
GifMakeMapObject(), GifFreeMapObject(), and GifUnionColorMap()
|
||||
respectively.</p></li></ul></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm419"></a>Error handling:</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Library error handling no longer uses a static cell to
|
||||
store the last error code registered; that made the library
|
||||
thread-unsafe.</p></li><li class="listitem"><p>For functions other than GIF file openers, the Error
|
||||
code is now put in an Error member of the GifFileType
|
||||
structure.</p></li><li class="listitem"><p>The GifError() and
|
||||
GifLastError() functions that referenced that static cell are gone,
|
||||
and the GifErrorString() function introduced in the 4.2 release now
|
||||
takes an explicit error code argument.</p></li></ul></div></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm428"></a>Skeletons of GIF filters</h2></div></div></div><p>If you are developing on a virtual-memory OS such as most flavors of
|
||||
UNIX, or are otherwise sure of having enough memory to keep all of GIFs you
|
||||
need to operate in core, writing a filter is trivial. See the file
|
||||
gifsponge.c in util.</p><p>A sequential filter skeleton will usually look like the example file
|
||||
giffilter.c in util.</p><p>Please look at the utilities in the util directory for more ideas once
|
||||
you feel comfortable with these skeletons. Also try to follow the coding
|
||||
standards of this package if you want the maintainer to officially add your new
|
||||
utility to it.</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm433"></a>Unimplemented features</h2></div></div></div><p>Some features of the original GIF specification have not stood the
|
||||
test of time. This library mostly ignores them, but they are described
|
||||
here for completeness.</p><p>The GIF standard fails to be explicit about a small but crucial detail:
|
||||
the unsigned two-byte integer fields in it are little-endian.</p><p>The GIF format seems to have been designed with the idea that viewers
|
||||
would render multiple images in a GIF on a common canvas, giving an effect like
|
||||
a picture wall. The 'logical screen descriptor block' (LSDB), 6 bytes right
|
||||
after the 6-byte GIF stamp and version header at the beginning of a
|
||||
GIF file, includes both two-byte canvas width and canvas height
|
||||
fields and a canvas background color. Each image, besides height and
|
||||
width, also has 'left' and 'top' cordinates specifying where it is to
|
||||
be placed on the canvas.</p><p>GIFLIB can read and set these fields; the gifpos and giftool
|
||||
utilities will enable you to script such changes. But browsers and
|
||||
modern image viewers ignore them. Nowadays multiple-image GIFs are
|
||||
generally used either as animations in which each sub-image is a frame
|
||||
or as image libraries, with the GIF client handling compositing into
|
||||
some canvas about which the GIF format holds no information.</p><p>Another feature of the LSDB that is generally ignored is the
|
||||
pixel aspect ratio byte. Until 5.0, GIFLIB ignored this flag on input
|
||||
and zeroed it on output; now it is read and preserved if present. The
|
||||
GIF standard doesn't give a rationale for it, but it seems likely that
|
||||
the designers intended it for representing image captures from the
|
||||
analog television of the day, which had rectangular pixel-equivalents.</p><p>Yet another ignored feature of both the LSDB and sub-images is
|
||||
the sort flag, which is supposed to signal whether the colors in the
|
||||
associated color map are sorted by decreasing importance in case the
|
||||
display device can only render a limited number of them. This feature
|
||||
reflected the high cost of dual-port memory at the time the GIF
|
||||
specification was written in the late 1980s. That kind of limit
|
||||
disappeared in the mid-1990s. Until 5.0, GIFLIB ignored this flag on
|
||||
input and zeroed it on output; now it is read and preserved if
|
||||
present.</p><p>Finally, the plaintext extension block. This is an extension block
|
||||
that contains instructions for overlaying text captions on a following image.
|
||||
GIFLIB treats these blocks as raw data, not attempting to parse out the
|
||||
location and text data.</p></div></div></body></html>
|
||||
@@ -0,0 +1,129 @@
|
||||
'\" t
|
||||
.\" Title: gifbg
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 2 May 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIFBG" "1" "2 May 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
gifbg \- generate a test\-pattern GIF
|
||||
.SH "SYNOPSIS"
|
||||
.HP \w'\fBgifbg\fR\ 'u
|
||||
\fBgifbg\fR [\-v] [\-d\ \fIdir\fR] [\-l\ \fIlvls\fR] [\-c\ \fIR\fR\ \fIG\fR\ \fIB\fR] [\-m\ \fImin\fR] [\-o\ \fImax\fR] [\-s\ \fIw\fR\ \fIh\fR] [\-h]
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
A program to generate a single\-color test pattern GIF with gradually changing intensity in any of the basic 8 directions\&.
|
||||
.PP
|
||||
The gifbg program reads no input, and will dump the created GIF file to stdout\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\-v
|
||||
.RS 4
|
||||
Verbose mode (show progress)\&. Enables printout of running scan lines\&.
|
||||
.RE
|
||||
.PP
|
||||
\-d dir
|
||||
.RS 4
|
||||
Select direction the intensity of the background should increase\&. Direction can be one of the 8 principal directions:
|
||||
.PP
|
||||
"T"
|
||||
.RS 4
|
||||
for Top
|
||||
.RE
|
||||
.PP
|
||||
"TR"
|
||||
.RS 4
|
||||
for Top Right
|
||||
.RE
|
||||
.PP
|
||||
"R"
|
||||
.RS 4
|
||||
for Right
|
||||
.RE
|
||||
.PP
|
||||
"BR"
|
||||
.RS 4
|
||||
for Bottom Right
|
||||
.RE
|
||||
.PP
|
||||
"B"
|
||||
.RS 4
|
||||
for Bottom
|
||||
.RE
|
||||
.PP
|
||||
"BL"
|
||||
.RS 4
|
||||
for Bottom Left
|
||||
.RE
|
||||
.PP
|
||||
"L"
|
||||
.RS 4
|
||||
for left
|
||||
.RE
|
||||
.PP
|
||||
"TL"
|
||||
.RS 4
|
||||
for Top Left
|
||||
.RE
|
||||
.sp
|
||||
The compass directions may be use as synonyms for the above directions, so for example "NE" is equal to "TR"\&.
|
||||
.sp
|
||||
Direction is case insensitive\&. The default direction is Top (North)\&.
|
||||
.RE
|
||||
.PP
|
||||
\-l lvls
|
||||
.RS 4
|
||||
Numeric, nmber of levels the color will be scaled to\&. Default is 16\&.
|
||||
.RE
|
||||
.PP
|
||||
\-c R G B
|
||||
.RS 4
|
||||
What to use as the primary background color to scale\&. This color is scaled between the minimum intensity (min) and maximum intensity (max) from one end of the screen to the other as defined by dir\&. See below (\-m & \-M) for min & max\&. Default is Blue (0, 0, 255)\&.
|
||||
.RE
|
||||
.PP
|
||||
\-m min
|
||||
.RS 4
|
||||
Minimum intensity (in percent) to scale color\&. Default 10%
|
||||
.RE
|
||||
.PP
|
||||
[\-M max
|
||||
.RS 4
|
||||
Maximum intensity (in percent) to scale color\&. Default 100%
|
||||
.RE
|
||||
.PP
|
||||
\-s W H
|
||||
.RS 4
|
||||
Size of image to create\&. Default 640 by 350\&.
|
||||
.RE
|
||||
.PP
|
||||
\-h
|
||||
.RS 4
|
||||
Print one line of command line help, similar to Usage above\&.
|
||||
.RE
|
||||
.PP
|
||||
If min == max = 100 (%) and lvls == 2 then boolean mask image of specified size will be created \- all foreground\&.
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
Gershon Elber\&.
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>gifbg</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="gifbg.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>gifbg — generate a test-pattern GIF</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">gifbg</code> [-v] [-d <em class="replaceable"><code>dir</code></em>] [-l <em class="replaceable"><code>lvls</code></em>] [-c
|
||||
<em class="replaceable"><code>R</code></em>
|
||||
<em class="replaceable"><code>G</code></em>
|
||||
<em class="replaceable"><code>B</code></em>] [-m <em class="replaceable"><code>min</code></em>] [-o <em class="replaceable"><code>max</code></em>] [-s
|
||||
<em class="replaceable"><code>w</code></em>
|
||||
<em class="replaceable"><code>h</code></em>] [-h]</p></div></div><div class="refsect1"><a id="idm32"></a><h2>Description</h2><p>A program to generate a single-color test pattern GIF with
|
||||
gradually changing intensity in any of the basic 8 directions.</p><p>The gifbg program reads no input, and will dump the created GIF file
|
||||
to stdout.</p></div><div class="refsect1"><a id="idm36"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><p> Verbose mode (show progress).
|
||||
Enables printout of running scan lines.</p></dd><dt><span class="term">-d dir</span></dt><dd><p>Select direction the intensity of the background should
|
||||
increase. Direction can be one of the 8 principal directions:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">"T"</span></dt><dd><p>for Top</p></dd><dt><span class="term">"TR"</span></dt><dd><p>for Top Right</p></dd><dt><span class="term">"R"</span></dt><dd><p>for Right</p></dd><dt><span class="term">"BR"</span></dt><dd><p>for Bottom Right</p></dd><dt><span class="term">"B"</span></dt><dd><p>for Bottom</p></dd><dt><span class="term">"BL"</span></dt><dd><p>for Bottom Left</p></dd><dt><span class="term">"L"</span></dt><dd><p>for left</p></dd><dt><span class="term">"TL"</span></dt><dd><p>for Top Left</p></dd></dl></div><p>The compass directions may be use as synonyms for the above directions, so
|
||||
for example "NE" is equal to "TR".</p><p>Direction is case insensitive. The default direction is Top
|
||||
(North).</p></dd><dt><span class="term"> -l lvls</span></dt><dd><p> Numeric, nmber of levels the color will be scaled to. Default is 16.</p></dd><dt><span class="term"> -c R G B</span></dt><dd><p> What to use as the primary background color to scale. This
|
||||
color is scaled between the minimum intensity (min) and maximum
|
||||
intensity (max) from one end of the screen to the other as defined by
|
||||
dir. See below (-m & -M) for min & max. Default is Blue (0,
|
||||
0, 255).</p></dd><dt><span class="term"> -m min</span></dt><dd><p> Minimum intensity (in percent) to scale color. Default 10%</p></dd><dt><span class="term"> [-M max</span></dt><dd><p> Maximum intensity (in percent) to scale color. Default 100%</p></dd><dt><span class="term"> -s W H</span></dt><dd><p> Size of image to create. Default 640 by 350.</p></dd><dt><span class="term"> -h</span></dt><dd><p> Print one line of command line help, similar to Usage above.</p></dd></dl></div><p>If min == max = 100 (%) and lvls == 2 then boolean mask image
|
||||
of specified size will be created - all foreground.</p></div><div class="refsect1"><a id="idm107"></a><h2>Author</h2><p>Gershon Elber.</p></div></div></body></html>
|
||||
@@ -0,0 +1,145 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||
<refentry id='gifbg.1'>
|
||||
<refentryinfo><date>2 May 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>gifbg</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>gifbg</refname>
|
||||
<refpurpose>generate a test-pattern GIF</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>gifbg</command>
|
||||
<arg choice='opt'>-v</arg>
|
||||
<arg choice='opt'>-d <replaceable>dir</replaceable></arg>
|
||||
<arg choice='opt'>-l <replaceable>lvls</replaceable></arg>
|
||||
<arg choice='opt'>-c
|
||||
<replaceable>R</replaceable>
|
||||
<replaceable>G</replaceable>
|
||||
<replaceable>B</replaceable></arg>
|
||||
<arg choice='opt'>-m <replaceable>min</replaceable></arg>
|
||||
<arg choice='opt'>-o <replaceable>max</replaceable></arg>
|
||||
<arg choice='opt'>-s
|
||||
<replaceable>w</replaceable>
|
||||
<replaceable>h</replaceable></arg>
|
||||
<arg choice='opt'>-h</arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
|
||||
<para>A program to generate a single-color test pattern GIF with
|
||||
gradually changing intensity in any of the basic 8 directions.</para>
|
||||
|
||||
<para>The gifbg program reads no input, and will dump the created GIF file
|
||||
to stdout.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Options</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para> Verbose mode (show progress).
|
||||
Enables printout of running scan lines.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-d dir</term>
|
||||
<listitem>
|
||||
<para>Select direction the intensity of the background should
|
||||
increase. Direction can be one of the 8 principal directions:</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>"T"</term>
|
||||
<listitem><para>for Top</para></listitem></varlistentry>
|
||||
<varlistentry>
|
||||
<term>"TR"</term>
|
||||
<listitem><para>for Top Right</para></listitem></varlistentry>
|
||||
<varlistentry>
|
||||
<term>"R"</term>
|
||||
<listitem><para>for Right</para></listitem></varlistentry>
|
||||
<varlistentry>
|
||||
<term>"BR"</term>
|
||||
<listitem><para>for Bottom Right</para></listitem></varlistentry>
|
||||
<varlistentry>
|
||||
<term>"B"</term>
|
||||
<listitem><para>for Bottom</para></listitem></varlistentry>
|
||||
<varlistentry>
|
||||
<term>"BL"</term>
|
||||
<listitem><para>for Bottom Left</para></listitem></varlistentry>
|
||||
<varlistentry>
|
||||
<term>"L"</term>
|
||||
<listitem><para>for left</para></listitem></varlistentry>
|
||||
<varlistentry>
|
||||
<term>"TL"</term>
|
||||
<listitem><para>for Top Left</para></listitem></varlistentry>
|
||||
</variablelist>
|
||||
<para>The compass directions may be use as synonyms for the above directions, so
|
||||
for example "NE" is equal to "TR".</para>
|
||||
<para>Direction is case insensitive. The default direction is Top
|
||||
(North).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term> -l lvls</term>
|
||||
<listitem>
|
||||
<para> Numeric, nmber of levels the color will be scaled to. Default is 16.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term> -c R G B</term>
|
||||
<listitem>
|
||||
<para> What to use as the primary background color to scale. This
|
||||
color is scaled between the minimum intensity (min) and maximum
|
||||
intensity (max) from one end of the screen to the other as defined by
|
||||
dir. See below (-m & -M) for min & max. Default is Blue (0,
|
||||
0, 255).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term> -m min</term>
|
||||
<listitem>
|
||||
<para> Minimum intensity (in percent) to scale color. Default 10%</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term> [-M max</term>
|
||||
<listitem>
|
||||
<para> Maximum intensity (in percent) to scale color. Default 100%</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term> -s W H</term>
|
||||
<listitem>
|
||||
<para> Size of image to create. Default 640 by 350.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term> -h</term>
|
||||
<listitem>
|
||||
<para> Print one line of command line help, similar to Usage above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>If min == max = 100 (%) and lvls == 2 then boolean mask image
|
||||
of specified size will be created - all foreground.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Author</title>
|
||||
|
||||
<para>Gershon Elber.</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
@@ -0,0 +1,180 @@
|
||||
'\" t
|
||||
.\" Title: gifbuild
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 2 May 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIFBUILD" "1" "2 May 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
gifbuild \- dump GIF data in a textual format, or undump it to a GIF
|
||||
.SH "SYNOPSIS"
|
||||
.HP \w'\fBgifbuild\fR\ 'u
|
||||
\fBgifbuild\fR [\-v] [\-a] [\-d] [\-t\ \fItranslation\-table\fR] [\-h] [\fIgif\-file\fR]
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
A program to convert a series of editable text GIF icon specifications and named GIF files into a multi\-image GIF, usable as a graphic resource file\&. It can also dump existing GIFs in this format\&. When dumping a GIF, certain sanity checks are performed which may result in a warning emitted to standard error\&.
|
||||
.PP
|
||||
If no GIF file is given, gifbuild will try to read a text input from stdin\&.
|
||||
.SH "SPECIFICATION SYNTAX"
|
||||
.PP
|
||||
Here is a syntax summary in informal BNF\&. The token `NL\*(Aq represents a required newline\&.
|
||||
.sp
|
||||
.if n \{\
|
||||
.RS 4
|
||||
.\}
|
||||
.nf
|
||||
<gif\-spec> ::= <header\-block> <image\-block>\&.\&.\&.
|
||||
|
||||
<header\-block> ::= <header\-declaration>\&.\&.\&.
|
||||
|
||||
<header\-declaration ::=
|
||||
| screen width <digits> NL
|
||||
| screen height <digits> NL
|
||||
| screen colors <digits> NL
|
||||
| screen background <digits> NL
|
||||
| pixel aspect byte <digits> NL
|
||||
| screen map <color\-table> NL
|
||||
|
||||
<color\-table> ::= <color\-declaration>\&.\&.\&. end NL
|
||||
|
||||
<color\-declaration> ::= rgb <digits> <digits> <digits> [ is <key>] NL
|
||||
| sort flag {on|off} NL
|
||||
|
||||
<image\-block> ::= include <file\-name> NL
|
||||
| image NL
|
||||
<image\-declaration>\&.\&.\&.
|
||||
<raster\-picture>
|
||||
[ <extension> ]
|
||||
|
||||
<image\-declarations> ::= image top <digits> NL
|
||||
| image left <digits> NL
|
||||
| image interlaced NL
|
||||
| image map <color\-table> NL
|
||||
| image bits <digits> by <digits> [hex|ascii] NL <raster\-block>
|
||||
|
||||
<extension> := <comment> NL <extension\-block> NL end NL
|
||||
| <plaintext> NL <extension\-block> NL end NL
|
||||
| graphics control NL <GCB\-part> NL end NL
|
||||
| netscape loop <digits> NL
|
||||
| extension <hex\-digits> NL <extension\-block> NL end NL
|
||||
|
||||
<GCB\-part> ::= disposal mode <digits> NL
|
||||
| user input flag {on|off} NL
|
||||
| delay <digits> NL
|
||||
| transparent index <digits> NL
|
||||
|
||||
.fi
|
||||
.if n \{\
|
||||
.RE
|
||||
.\}
|
||||
.PP
|
||||
If the data types of the
|
||||
\(lqscreen height\(rq,
|
||||
\(lqscreen width\(rq,
|
||||
\(lqscreen background\(rq,
|
||||
\(lqimage top\(rq, and
|
||||
\(lqimage left\(rq
|
||||
declarations aren\*(Aqt obvious to you, what are you doing with this software?
|
||||
.PP
|
||||
The
|
||||
\(lqpixel aspect byte\(rq
|
||||
declaration sets an integer denominator for a fraction expressing the puxel aspect ratio\&. See the GIF standard for details; this field is actually long obsolete\&.
|
||||
.PP
|
||||
A color table declares color indices (in ascending order from 0) and may associate them with key characters (these associations are absent when the map is more than 94 colors lang and raster blocks using it must use hex pairs)\&. These characters can later be used in raster blocks\&. As these must be printable and non\-whitespace, you can only specify 94 colors per icon\&. Life is like that sometimes\&.
|
||||
.PP
|
||||
A color table declaration can also set the table\*(Aqs sort flag with "sort flag on" or "sort flag off" on any line before the end\&.
|
||||
.PP
|
||||
An
|
||||
\(lqascii\(rq
|
||||
raster block is just a block of key characters (used for a color map of 94 or fewer colors)\&. A
|
||||
\(lqhex\(rq
|
||||
raster block uses hex digit pairs instead (used for a color map with more than 94 colors)\&. The default is ASCII\&. It should be sized correctly for the
|
||||
\(lqimage bits\(rq
|
||||
declaration that leads it\&. Raster blocks from interlaced GIFs are dumped with the lines in non\-interlaced order\&.
|
||||
.PP
|
||||
The
|
||||
\(lqcomment\(rq,
|
||||
\(lqplaintext\(rq
|
||||
or
|
||||
\(lqggraphics control\(rq
|
||||
keywords lead defined GIF89 extension record data\&. The final GIF89 type, graphics control and application block, are not yet supported, but the code does recognize a Netscape loop block\&. You can also say
|
||||
\(lqextension\(rq
|
||||
followed by a hexadecimal record type\&. All of these extension declarations must be followed by an extension block, which is terminated by the keyword
|
||||
\(lqend\(rq
|
||||
on its own line\&.
|
||||
.PP
|
||||
An extension block is a series of text lines, each interpreted as a string of bytes to fill an extension block (the terminating newline is stripped)\&. Text may include standard C\-style octal and hex escapes preceded by a backslash\&.
|
||||
.PP
|
||||
A graphics control block declaration creates a graphics control extension block; for the field semantics see the GIF89 standard, part 23\&.
|
||||
.PP
|
||||
A netscape loop declaration creates an application extension block containing a NETSCAPE 2\&.0 animation loop control with a specified repeat count (repeat count 0 means loop forever)\&. This must be immediately after the header declaration\&. These loop blocks are interpreted by the Netscape/Mozilla/Firefox line of browsers\&.
|
||||
.PP
|
||||
All <digits> tokens are interpreted as decimal numerals; <hex\-digits> tokens are interpreted as two hex digits (a byte)\&. All coordinates are zero\-origin with the top left corner (0,0)\&. Range checking is weak and signedness checking nonexistent; caveat hacker!
|
||||
.PP
|
||||
In general, the amount of whitespace and order of declarations within a header or image block is not significant, except that a raster picture must immediately follow its
|
||||
\(lqimage bits\(rq
|
||||
bits declaration\&.
|
||||
.PP
|
||||
The
|
||||
\(lqinclude\(rq
|
||||
declaration includes a named GIF as the next image\&. The global color maps of included GIFs are merged with the base table defined by any
|
||||
\(lqscreen color\(rq
|
||||
declaration\&. All images of an included multi\-image GIF will be included in order\&.
|
||||
.PP
|
||||
Comments (preceded with
|
||||
\(lq#\(rq) will be ignored\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\-v
|
||||
.RS 4
|
||||
Verbose mode (show progress)\&. Enables printout of running scan lines\&.
|
||||
.RE
|
||||
.PP
|
||||
\-d
|
||||
.RS 4
|
||||
Dump the input GIF file(s) into the text form described above\&.
|
||||
.RE
|
||||
.PP
|
||||
\-t
|
||||
.RS 4
|
||||
Specify name characters to use when dumping raster blocks\&. Only valid with \-d option\&.
|
||||
.RE
|
||||
.PP
|
||||
\-h
|
||||
.RS 4
|
||||
Print one line of command line help, similar to Usage above\&.
|
||||
.RE
|
||||
.SH "BUGS"
|
||||
.PP
|
||||
Error checking is rudimentary\&.
|
||||
.SH "EXAMPLE:"
|
||||
.PP
|
||||
A sample icon file called
|
||||
sample\&.ico
|
||||
is included in the pic directory of the GIFLIB source distribution\&.
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
Eric S\&. Raymond
|
||||
<esr@thyrsus\&.com>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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
|
||||
named GIF files into a multi-image GIF, usable as a graphic resource file.
|
||||
It can also dump existing GIFs in this format. When dumping a GIF,
|
||||
certain sanity checks are performed which may result in a warning
|
||||
emitted to standard error.</p><p>If no GIF file is given, gifbuild will try to read a text input
|
||||
from 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
|
||||
required newline.</p><pre class="programlisting">
|
||||
<gif-spec> ::= <header-block> <image-block>...
|
||||
|
||||
<header-block> ::= <header-declaration>...
|
||||
|
||||
<header-declaration ::=
|
||||
| screen width <digits> NL
|
||||
| screen height <digits> NL
|
||||
| screen colors <digits> NL
|
||||
| screen background <digits> NL
|
||||
| pixel aspect byte <digits> NL
|
||||
| screen map <color-table> NL
|
||||
|
||||
<color-table> ::= <color-declaration>... end NL
|
||||
|
||||
<color-declaration> ::= rgb <digits> <digits> <digits> [ is <key>] NL
|
||||
| sort flag {on|off} NL
|
||||
|
||||
<image-block> ::= include <file-name> NL
|
||||
| image NL
|
||||
<image-declaration>...
|
||||
<raster-picture>
|
||||
[ <extension> ]
|
||||
|
||||
<image-declarations> ::= image top <digits> NL
|
||||
| image left <digits> NL
|
||||
| image interlaced NL
|
||||
| image map <color-table> NL
|
||||
| image bits <digits> by <digits> [hex|ascii] NL <raster-block>
|
||||
|
||||
<extension> := <comment> NL <extension-block> NL end NL
|
||||
| <plaintext> NL <extension-block> NL end NL
|
||||
| graphics control NL <GCB-part> NL end NL
|
||||
| netscape loop <digits> NL
|
||||
| extension <hex-digits> NL <extension-block> NL end NL
|
||||
|
||||
<GCB-part> ::= disposal mode <digits> NL
|
||||
| user input flag {on|off} NL
|
||||
| delay <digits> NL
|
||||
| transparent index <digits> NL
|
||||
|
||||
</pre><p>If the data types of the <span class="quote">“<span class="quote">screen height</span>”</span>,
|
||||
<span class="quote">“<span class="quote">screen width</span>”</span>, <span class="quote">“<span class="quote">screen background</span>”</span>,
|
||||
<span class="quote">“<span class="quote">image top</span>”</span>, and <span class="quote">“<span class="quote">image left</span>”</span> declarations
|
||||
aren'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
|
||||
denominator for a fraction expressing the puxel aspect ratio. See the
|
||||
GIF standard for details; this field is actually long obsolete.</p><p>A color table declares color indices (in ascending order from 0)
|
||||
and may associate them with key characters (these associations are
|
||||
absent when the map is more than 94 colors lang and raster blocks
|
||||
using it must use hex pairs). These characters can later be used in
|
||||
raster blocks. As these must be printable and non-whitespace, you can
|
||||
only 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
|
||||
"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
|
||||
characters (used for a color map of 94 or fewer colors). A
|
||||
<span class="quote">“<span class="quote">hex</span>”</span> raster block uses hex digit pairs instead (used for
|
||||
a color map with more than 94 colors). The default is ASCII. It
|
||||
should be sized correctly for the <span class="quote">“<span class="quote">image bits</span>”</span>
|
||||
declaration that leads it. Raster blocks from interlaced GIFs are
|
||||
dumped 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
|
||||
<span class="quote">“<span class="quote">ggraphics control</span>”</span> keywords lead defined GIF89 extension
|
||||
record data. The final GIF89 type, graphics control and application
|
||||
block, are not yet supported, but the code does recognize a Netscape
|
||||
loop block. You can also say <span class="quote">“<span class="quote">extension</span>”</span> followed by a
|
||||
hexadecimal record type. All of these extension declarations must be
|
||||
followed by an extension block, which is terminated by the keyword
|
||||
<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
|
||||
as a string of bytes to fill an extension block (the terminating
|
||||
newline is stripped). Text may include standard C-style octal and hex
|
||||
escapes preceded by a backslash.</p><p>A graphics control block declaration creates a graphics control
|
||||
extension block; for the field semantics see the GIF89 standard, part
|
||||
23.</p><p>A netscape loop declaration creates an application extension
|
||||
block containing a NETSCAPE 2.0 animation loop control with a
|
||||
specified repeat count (repeat count 0 means loop forever). This must
|
||||
be immediately after the header declaration. These loop blocks are
|
||||
interpreted by the Netscape/Mozilla/Firefox line of browsers.</p><p>All <digits> tokens are interpreted as decimal numerals;
|
||||
<hex-digits> tokens are interpreted as two hex digits (a byte). All
|
||||
coordinates are zero-origin with the top left corner (0,0). Range
|
||||
checking is weak and signedness checking nonexistent; caveat
|
||||
hacker!</p><p>In general, the amount of whitespace and order of declarations within a
|
||||
header or image block is not significant, except that a raster picture
|
||||
must 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
|
||||
the next image. The global color maps of included GIFs are merged
|
||||
with the base table defined by any <span class="quote">“<span class="quote">screen color</span>”</span>
|
||||
declaration. All images of an included multi-image GIF will be
|
||||
included 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).
|
||||
Enables 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
|
||||
above.</p></dd><dt><span class="term">-t</span></dt><dd><p>Specify name characters to use when dumping raster blocks. Only
|
||||
valid with -d option.</p></dd><dt><span class="term">-h</span></dt><dd><p>Print one line of command line help, similar to Usage
|
||||
above.</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
|
||||
included in the pic directory of the GIFLIB source
|
||||
distribution.</p></div><div class="refsect1"><a id="idm88"></a><h2>Author</h2><p>Eric S. Raymond <code class="email"><<a class="email" href="mailto:esr@thyrsus.com">esr@thyrsus.com</a>></code></p></div></div></body></html>
|
||||
@@ -0,0 +1,217 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
||||
<!ENTITY email "esr@thyrsus.com">
|
||||
]>
|
||||
<refentry id='gifbuild.1'>
|
||||
<refentryinfo><date>2 May 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>gifbuild</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>gifbuild</refname>
|
||||
<refpurpose>dump GIF data in a textual format, or undump it to a GIF</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>gifbuild</command>
|
||||
<arg choice='opt'>-v</arg>
|
||||
<arg choice='opt'>-a</arg>
|
||||
<arg choice='opt'>-d</arg>
|
||||
<arg choice='opt'>-t <replaceable>translation-table</replaceable></arg>
|
||||
<arg choice='opt'>-h</arg>
|
||||
<arg choice='opt'><replaceable>gif-file</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Options</title>
|
||||
|
||||
<para>A program to convert a series of editable text GIF icon specifications and
|
||||
named GIF files into a multi-image GIF, usable as a graphic resource file.
|
||||
It can also dump existing GIFs in this format. When dumping a GIF,
|
||||
certain sanity checks are performed which may result in a warning
|
||||
emitted to standard error.</para>
|
||||
|
||||
<para>If no GIF file is given, gifbuild will try to read a text input
|
||||
from stdin.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Specification Syntax</title>
|
||||
|
||||
<para>Here is a syntax summary in informal BNF. The token `NL' represents a
|
||||
required newline.</para>
|
||||
|
||||
<programlisting>
|
||||
<gif-spec> ::= <header-block> <image-block>...
|
||||
|
||||
<header-block> ::= <header-declaration>...
|
||||
|
||||
<header-declaration ::=
|
||||
| screen width <digits> NL
|
||||
| screen height <digits> NL
|
||||
| screen colors <digits> NL
|
||||
| screen background <digits> NL
|
||||
| pixel aspect byte <digits> NL
|
||||
| screen map <color-table> NL
|
||||
|
||||
<color-table> ::= <color-declaration>... end NL
|
||||
|
||||
<color-declaration> ::= rgb <digits> <digits> <digits> [ is <key>] NL
|
||||
| sort flag {on|off} NL
|
||||
|
||||
<image-block> ::= include <file-name> NL
|
||||
| image NL
|
||||
<image-declaration>...
|
||||
<raster-picture>
|
||||
[ <extension> ]
|
||||
|
||||
<image-declarations> ::= image top <digits> NL
|
||||
| image left <digits> NL
|
||||
| image interlaced NL
|
||||
| image map <color-table> NL
|
||||
| image bits <digits> by <digits> [hex|ascii] NL <raster-block>
|
||||
|
||||
<extension> := <comment> NL <extension-block> NL end NL
|
||||
| <plaintext> NL <extension-block> NL end NL
|
||||
| graphics control NL <GCB-part> NL end NL
|
||||
| netscape loop <digits> NL
|
||||
| extension <hex-digits> NL <extension-block> NL end NL
|
||||
|
||||
<GCB-part> ::= disposal mode <digits> NL
|
||||
| user input flag {on|off} NL
|
||||
| delay <digits> NL
|
||||
| transparent index <digits> NL
|
||||
|
||||
</programlisting>
|
||||
|
||||
<para>If the data types of the <quote>screen height</quote>,
|
||||
<quote>screen width</quote>, <quote>screen background</quote>,
|
||||
<quote>image top</quote>, and <quote>image left</quote> declarations
|
||||
aren't obvious to you, what are you doing with this software?</para>
|
||||
|
||||
<para>The <quote>pixel aspect byte</quote> declaration sets an integer
|
||||
denominator for a fraction expressing the puxel aspect ratio. See the
|
||||
GIF standard for details; this field is actually long obsolete.</para>
|
||||
|
||||
<para>A color table declares color indices (in ascending order from 0)
|
||||
and may associate them with key characters (these associations are
|
||||
absent when the map is more than 94 colors lang and raster blocks
|
||||
using it must use hex pairs). These characters can later be used in
|
||||
raster blocks. As these must be printable and non-whitespace, you can
|
||||
only specify 94 colors per icon. Life is like that sometimes.</para>
|
||||
|
||||
<para>A color table declaration can also set the table's sort flag with
|
||||
"sort flag on" or "sort flag off" on any line before the end.</para>
|
||||
|
||||
<para>An <quote>ascii</quote> raster block is just a block of key
|
||||
characters (used for a color map of 94 or fewer colors). A
|
||||
<quote>hex</quote> raster block uses hex digit pairs instead (used for
|
||||
a color map with more than 94 colors). The default is ASCII. It
|
||||
should be sized correctly for the <quote>image bits</quote>
|
||||
declaration that leads it. Raster blocks from interlaced GIFs are
|
||||
dumped with the lines in non-interlaced order.</para>
|
||||
|
||||
<para>The <quote>comment</quote>, <quote>plaintext</quote> or
|
||||
<quote>ggraphics control</quote> keywords lead defined GIF89 extension
|
||||
record data. The final GIF89 type, graphics control and application
|
||||
block, are not yet supported, but the code does recognize a Netscape
|
||||
loop block. You can also say <quote>extension</quote> followed by a
|
||||
hexadecimal record type. All of these extension declarations must be
|
||||
followed by an extension block, which is terminated by the keyword
|
||||
<quote>end</quote> on its own line.</para>
|
||||
|
||||
<para>An extension block is a series of text lines, each interpreted
|
||||
as a string of bytes to fill an extension block (the terminating
|
||||
newline is stripped). Text may include standard C-style octal and hex
|
||||
escapes preceded by a backslash.</para>
|
||||
|
||||
<para>A graphics control block declaration creates a graphics control
|
||||
extension block; for the field semantics see the GIF89 standard, part
|
||||
23.</para>
|
||||
|
||||
<para>A netscape loop declaration creates an application extension
|
||||
block containing a NETSCAPE 2.0 animation loop control with a
|
||||
specified repeat count (repeat count 0 means loop forever). This must
|
||||
be immediately after the header declaration. These loop blocks are
|
||||
interpreted by the Netscape/Mozilla/Firefox line of browsers.</para>
|
||||
|
||||
<para>All <digits> tokens are interpreted as decimal numerals;
|
||||
<hex-digits> tokens are interpreted as two hex digits (a byte). All
|
||||
coordinates are zero-origin with the top left corner (0,0). Range
|
||||
checking is weak and signedness checking nonexistent; caveat
|
||||
hacker!</para>
|
||||
|
||||
<para>In general, the amount of whitespace and order of declarations within a
|
||||
header or image block is not significant, except that a raster picture
|
||||
must immediately follow its <quote>image bits</quote> bits declaration.</para>
|
||||
|
||||
<para>The <quote>include</quote> declaration includes a named GIF as
|
||||
the next image. The global color maps of included GIFs are merged
|
||||
with the base table defined by any <quote>screen color</quote>
|
||||
declaration. All images of an included multi-image GIF will be
|
||||
included in order.</para>
|
||||
|
||||
<para>Comments (preceded with <quote>#</quote>) will be ignored.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Options</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para>Verbose mode (show progress).
|
||||
Enables printout of running scan lines.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-d</term>
|
||||
<listitem>
|
||||
<para> Dump the input GIF file(s) into the text form described
|
||||
above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-t</term>
|
||||
<listitem>
|
||||
<para>Specify name characters to use when dumping raster blocks. Only
|
||||
valid with -d option.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-h</term>
|
||||
<listitem>
|
||||
<para>Print one line of command line help, similar to Usage
|
||||
above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Bugs</title>
|
||||
|
||||
<para>Error checking is rudimentary.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Example:</title>
|
||||
|
||||
<para>A sample icon file called <filename>sample.ico</filename> is
|
||||
included in the pic directory of the GIFLIB source
|
||||
distribution.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Author</title>
|
||||
|
||||
<para>Eric S. Raymond <email>&email;</email></para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
@@ -0,0 +1,101 @@
|
||||
'\" t
|
||||
.\" Title: gifclrmp
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 2 May 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIFCLRMP" "1" "2 May 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
gifclrmp \- extract colormaps from GIF images
|
||||
.SH "SYNOPSIS"
|
||||
.HP \w'\fBgifclrmp\fR\ 'u
|
||||
\fBgifclrmp\fR [\-v] [\-s] [\-l\ \fImapfile\fR] [\-t\ \fItrans\fR] [\-g\ \fIgamma\fR] [\-i\ \fIimage\fR] [\-h] [\fIgif\-file\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
A program to modify GIF image colormaps\&. Any local colormap in a GIF file can be modified at a time, or the global screen one\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\-v
|
||||
.RS 4
|
||||
Verbose mode (show progress)\&. Enables printout of running scan lines\&.
|
||||
.RE
|
||||
.PP
|
||||
\-s
|
||||
.RS 4
|
||||
Select the global screen color map\&.
|
||||
.RE
|
||||
.PP
|
||||
\-l mapfile
|
||||
.RS 4
|
||||
Load color map from this file instead of selected color map\&.
|
||||
.RE
|
||||
.PP
|
||||
\-t trans
|
||||
.RS 4
|
||||
Change color index values\&. The change is made to both the selected color table and the raster bits of the selected image\&. A translation file is a list of pairs of `before\*(Aq and `after\*(Aq index values\&. At present, the `before\*(Aq index values must be in ascending order starting from 0\&.
|
||||
.RE
|
||||
.PP
|
||||
\-g gamma
|
||||
.RS 4
|
||||
Apply gamma correction to selected color map\&.
|
||||
.RE
|
||||
.PP
|
||||
\-i image
|
||||
.RS 4
|
||||
Select the color map of the numbered image\&.
|
||||
.RE
|
||||
.PP
|
||||
\-h
|
||||
.RS 4
|
||||
Print one command line help, similar to Usage above\&.
|
||||
.RE
|
||||
.PP
|
||||
If no GIF file is given, gifclip will try to read a GIF file from stdin\&.
|
||||
.SH "NOTES"
|
||||
.sp
|
||||
.RS 4
|
||||
.ie n \{\
|
||||
\h'-04'\(bu\h'+03'\c
|
||||
.\}
|
||||
.el \{\
|
||||
.sp -1
|
||||
.IP \(bu 2.3
|
||||
.\}
|
||||
The default operation is to dump out the selected color map in text format\&.
|
||||
.RE
|
||||
.sp
|
||||
.RS 4
|
||||
.ie n \{\
|
||||
\h'-04'\(bu\h'+03'\c
|
||||
.\}
|
||||
.el \{\
|
||||
.sp -1
|
||||
.IP \(bu 2.3
|
||||
.\}
|
||||
The file to load/dump is simply one color map entry per line\&. Each such entry line has four integers: "ColorIndex Red Green Blue", where color index is in ascending order starting from 1\&.
|
||||
.RE
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
Gershon Elber\&.
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>gifclrmp</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="gifclrmp.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>gifclrmp — extract colormaps from GIF images</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">gifclrmp</code> [-v] [-s] [-l <em class="replaceable"><code>mapfile</code></em>] [-t <em class="replaceable"><code>trans</code></em>] [-g <em class="replaceable"><code>gamma</code></em>] [-i <em class="replaceable"><code>image</code></em>] [-h] [<em class="replaceable"><code>gif-file</code></em>]</p></div></div><div class="refsect1"><a id="idm28"></a><h2>Description</h2><p>A program to modify GIF image colormaps. Any local colormap in
|
||||
a GIF file can be modified at a time, or the global screen one.</p></div><div class="refsect1"><a id="idm31"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><p> Verbose mode (show progress).
|
||||
Enables printout of running scan lines. </p></dd><dt><span class="term">-s</span></dt><dd><p>Select the global screen color map.</p></dd><dt><span class="term">-l mapfile</span></dt><dd><p> Load color map from this file instead of selected color
|
||||
map.</p></dd><dt><span class="term">-t trans</span></dt><dd><p>Change color index values. The change is made to both the
|
||||
selected color table and the raster bits of the selected image. A
|
||||
translation file is a list of pairs of `before' and `after' index
|
||||
values. At present, the `before' index values must be in ascending
|
||||
order starting from 0.</p></dd><dt><span class="term">-g gamma</span></dt><dd><p>Apply gamma correction to selected color map.</p></dd><dt><span class="term">-i image</span></dt><dd><p>Select the color map of the numbered image.</p></dd><dt><span class="term">-h</span></dt><dd><p>Print one command line help, similar to Usage above.</p></dd></dl></div><p>If no GIF file is given, gifclip will try to read a GIF file
|
||||
from stdin.</p></div><div class="refsect1"><a id="idm63"></a><h2>Notes</h2><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>The default operation is to dump out the selected color map in text
|
||||
format.</p></li><li class="listitem"><p>The file to load/dump is simply one color map entry per line. Each such
|
||||
entry line has four integers: "ColorIndex Red Green Blue", where color
|
||||
index is in ascending order starting from 1.</p></li></ul></div></div><div class="refsect1"><a id="idm70"></a><h2>Author</h2><p>Gershon Elber.</p></div></div></body></html>
|
||||
@@ -0,0 +1,116 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||
<refentry id='gifclrmp.1'>
|
||||
<refentryinfo><date>2 May 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>gifclrmp</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>gifclrmp</refname>
|
||||
<refpurpose>extract colormaps from GIF images</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>gifclrmp</command>
|
||||
<arg choice='opt'>-v</arg>
|
||||
<arg choice='opt'>-s</arg>
|
||||
<arg choice='opt'>-l <replaceable>mapfile</replaceable></arg>
|
||||
<arg choice='opt'>-t <replaceable>trans</replaceable></arg>
|
||||
<arg choice='opt'>-g <replaceable>gamma</replaceable></arg>
|
||||
<arg choice='opt'>-i <replaceable>image</replaceable></arg>
|
||||
<arg choice='opt'>-h</arg>
|
||||
<arg choice='opt'><replaceable>gif-file</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
|
||||
<para>A program to modify GIF image colormaps. Any local colormap in
|
||||
a GIF file can be modified at a time, or the global screen one.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Options</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para> Verbose mode (show progress).
|
||||
Enables printout of running scan lines. </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-s</term>
|
||||
<listitem>
|
||||
<para>Select the global screen color map.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-l mapfile</term>
|
||||
<listitem>
|
||||
<para> Load color map from this file instead of selected color
|
||||
map.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-t trans</term>
|
||||
<listitem>
|
||||
<para>Change color index values. The change is made to both the
|
||||
selected color table and the raster bits of the selected image. A
|
||||
translation file is a list of pairs of `before' and `after' index
|
||||
values. At present, the `before' index values must be in ascending
|
||||
order starting from 0.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-g gamma</term>
|
||||
<listitem>
|
||||
<para>Apply gamma correction to selected color map.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-i image</term>
|
||||
<listitem>
|
||||
<para>Select the color map of the numbered image.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-h</term>
|
||||
<listitem>
|
||||
<para>Print one command line help, similar to Usage above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>If no GIF file is given, gifclip will try to read a GIF file
|
||||
from stdin.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Notes</title>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>The default operation is to dump out the selected color map in text
|
||||
format.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>The file to load/dump is simply one color map entry per line. Each such
|
||||
entry line has four integers: "ColorIndex Red Green Blue", where color
|
||||
index is in ascending order starting from 1.</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Author</title>
|
||||
|
||||
<para>Gershon Elber.</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
@@ -0,0 +1,70 @@
|
||||
'\" t
|
||||
.\" Title: gifcolor
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 2 May 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIFCOLOR" "1" "2 May 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
gifcolor \- generate color test\-pattern GIFs
|
||||
.SH "SYNOPSIS"
|
||||
.HP \w'\fBgifcolor\fR\ 'u
|
||||
\fBgifcolor\fR [\-v] [\-b\ \fIbackground\fR] [\-h] [\fIcolormap\-file\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
A program to generate color test patterns\&. Feed it a color map file (as generated, say, by the \-s option of gifclrmp) and it will generate a GIF containing lines of the form\&.
|
||||
.sp
|
||||
.if n \{\
|
||||
.RS 4
|
||||
.\}
|
||||
.nf
|
||||
Color %\-3d: [%\-3d, %\-3d, %\-3d]:
|
||||
.fi
|
||||
.if n \{\
|
||||
.RE
|
||||
.\}
|
||||
.PP
|
||||
where the first number is the zero\-based color index, and the triple is the index\*(Aqs [Red, Green, Blue] value\&. There will be one such line for each color\&. Each line will be set in a simple 8x8 font in the color it describes; thus, any lines corresponding to the GIF\*(Aqs background color will be blank\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\-v
|
||||
.RS 4
|
||||
Verbose mode (show progress)\&. Enables printout of running scan lines\&.
|
||||
.RE
|
||||
.PP
|
||||
\-b
|
||||
.RS 4
|
||||
Set the image\*(Aqs backround color to a given numeric index\&.
|
||||
.RE
|
||||
.PP
|
||||
\-h
|
||||
.RS 4
|
||||
Print one line of command line help, similar to Usage above\&.
|
||||
.RE
|
||||
.PP
|
||||
If no colormap file is specified, the color map will be read from stdin\&.
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
Gershon Elber\&.
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>gifcolor</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="gifcolor.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>gifcolor — generate color test-pattern GIFs</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">gifcolor</code> [-v] [-b <em class="replaceable"><code>background</code></em>] [-h] [<em class="replaceable"><code>colormap-file</code></em>]</p></div></div><div class="refsect1"><a id="idm21"></a><h2>Description</h2><p>A program to generate color test patterns. Feed it a color map file (as
|
||||
generated, say, by the -s option of gifclrmp) and it will generate a GIF
|
||||
containing lines of the form.</p><pre class="programlisting">
|
||||
Color %-3d: [%-3d, %-3d, %-3d]:
|
||||
</pre><p>where the first number is the zero-based color index, and the
|
||||
triple is the index's [Red, Green, Blue] value. There will be one
|
||||
such line for each color. Each line will be set in a simple 8x8 font
|
||||
in the color it describes; thus, any lines corresponding to the GIF's
|
||||
background color will be blank.</p></div><div class="refsect1"><a id="idm26"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><p>Verbose mode (show progress).
|
||||
Enables printout of running scan lines. </p></dd><dt><span class="term">-b</span></dt><dd><p>Set the image's backround color to a given numeric index.</p></dd><dt><span class="term">-h</span></dt><dd><p>Print one line of command line help, similar to Usage above.</p></dd></dl></div><p>If no colormap file is specified, the color map will be read from stdin.</p></div><div class="refsect1"><a id="idm42"></a><h2>Author</h2><p>Gershon Elber.</p></div></div></body></html>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||
<refentry id='gifcolor.1'>
|
||||
<refentryinfo><date>2 May 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>gifcolor</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>gifcolor</refname>
|
||||
<refpurpose>generate color test-pattern GIFs</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>gifcolor</command>
|
||||
<arg choice='opt'>-v</arg>
|
||||
<arg choice='opt'>-b <replaceable>background</replaceable></arg>
|
||||
<arg choice='opt'>-h</arg>
|
||||
<arg choice='opt'><replaceable>colormap-file</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
|
||||
<para>A program to generate color test patterns. Feed it a color map file (as
|
||||
generated, say, by the -s option of gifclrmp) and it will generate a GIF
|
||||
containing lines of the form.</para>
|
||||
|
||||
<programlisting>
|
||||
Color %-3d: [%-3d, %-3d, %-3d]:
|
||||
</programlisting>
|
||||
|
||||
<para>where the first number is the zero-based color index, and the
|
||||
triple is the index's [Red, Green, Blue] value. There will be one
|
||||
such line for each color. Each line will be set in a simple 8x8 font
|
||||
in the color it describes; thus, any lines corresponding to the GIF's
|
||||
background color will be blank.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Options</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para>Verbose mode (show progress).
|
||||
Enables printout of running scan lines. </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-b</term>
|
||||
<listitem>
|
||||
<para>Set the image's backround color to a given numeric index.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-h</term>
|
||||
<listitem>
|
||||
<para>Print one line of command line help, similar to Usage above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>If no colormap file is specified, the color map will be read from stdin.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Author</title>
|
||||
|
||||
<para>Gershon Elber.</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
@@ -0,0 +1,76 @@
|
||||
'\" t
|
||||
.\" Title: gifecho
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 2 May 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIFECHO" "1" "2 May 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
gifecho \- generate a GIF from ASCII text
|
||||
.SH "SYNOPSIS"
|
||||
.HP \w'\fBgifecho\fR\ 'u
|
||||
\fBgifecho\fR [\-v] [\-s\ \fIcolormap\-size\fR] [\-f\ \fIforeground\fR] [\-c\ \fIR\fR\ \fIG\fR\ \fIB\fR] [\-t\ \fItext\fR] [\-h] [\fIgif\-file\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
A program to generate GIF images out of regular text\&. Text can be one line or multi\-line, and is converted using 8 by 8 fixed font\&.
|
||||
.PP
|
||||
This program reads stdin if no text is provided on the command line (\-t), and will dump the created GIF file to stdout\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\-v
|
||||
.RS 4
|
||||
Verbose mode (show progress)\&. Enables printout of running scan lines\&.
|
||||
.RE
|
||||
.PP
|
||||
\-s colormap\-size
|
||||
.RS 4
|
||||
Explicitly defines the size of the color map of the resulting gif image\&. Usually the image will be bicolor with fg as color 1, unless [\-f] is explicitly given in case the color map size will be big enough to hold it\&. However it is sometimes convenient to set the color map size to certain size while the fg color is small mainly so this image may be merged with another (images must match color map size)\&.
|
||||
.RE
|
||||
.PP
|
||||
\-f foreground
|
||||
.RS 4
|
||||
Select foreground index (background is always 0)\&. By default it is one and therefore the image result is bicolored\&. if FG is set to n then color map will be created with 2^k entries where 2^k > n for minimum k, assuming k <= 8\&. This color map will be all zeros except this foreground index\&. This option is useful if this text image should be integrated into other image colormap using their colors\&.
|
||||
.RE
|
||||
.PP
|
||||
\-c R G B
|
||||
.RS 4
|
||||
The color to use as the foreground color\&. White by default\&.
|
||||
.RE
|
||||
.PP
|
||||
\-t text
|
||||
.RS 4
|
||||
One line of text can be provided on the command line\&. Note you must encapsulate the Text within quotes if it has spaces (The quotes themselves are not treated as part of the text)\&. If no \-t option is provided, stdin is read until end of file\&.
|
||||
.RE
|
||||
.PP
|
||||
\-h
|
||||
.RS 4
|
||||
Print one line command line help, similar to Usage above\&.
|
||||
.RE
|
||||
.SH "NOTES"
|
||||
.PP
|
||||
There is a hardcoded limit of 100 the number of lines\&.
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
Gershon Elber\&.
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>gifecho</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="gifecho.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>gifecho — generate a GIF from ASCII text</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">gifecho</code> [-v] [-s <em class="replaceable"><code>colormap-size</code></em>] [-f <em class="replaceable"><code>foreground</code></em>] [-c
|
||||
<em class="replaceable"><code>R</code></em>
|
||||
<em class="replaceable"><code>G</code></em>
|
||||
<em class="replaceable"><code>B</code></em>] [-t <em class="replaceable"><code>text</code></em>] [-h] [<em class="replaceable"><code>gif-file</code></em>]</p></div></div><div class="refsect1"><a id="idm29"></a><h2>Description</h2><p>A program to generate GIF images out of regular text. Text can
|
||||
be one line or multi-line, and is converted using 8 by 8 fixed
|
||||
font.</p><p>This program reads stdin if no text is provided on the command line (-t),
|
||||
and will dump the created GIF file to stdout.</p></div><div class="refsect1"><a id="idm33"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><p>Verbose mode (show progress).
|
||||
Enables printout of running scan lines. </p></dd><dt><span class="term">-s colormap-size</span></dt><dd><p>Explicitly defines the size of the color map of the resulting gif image. Usually the image will be bicolor with fg as color 1, unless [-f] is explicitly given in case the color map size will be big enough to hold it. However it is sometimes convenient to set the color map size to certain size while the fg color is small mainly so this image may be merged with another (images must match color map size).</p></dd><dt><span class="term">-f foreground</span></dt><dd><p> Select foreground index (background is always 0). By default it is one and therefore the image result is bicolored. if FG is set to n then color map will be created with 2^k entries where 2^k > n for minimum k, assuming k <= 8. This color map will be all zeros except this foreground index. This option is useful if this text image should be integrated into other image colormap using their colors.</p></dd><dt><span class="term">-c R G B</span></dt><dd><p> The color to use as the foreground color. White by default.</p></dd><dt><span class="term">-t text</span></dt><dd><p> One line of text can be provided on the command line. Note you must encapsulate the Text within quotes if it has spaces (The quotes themselves are not treated as part of the text). If no -t option is provided, stdin is read until end of file.</p></dd><dt><span class="term">-h</span></dt><dd><p> Print one line command line help, similar to Usage above.</p></dd></dl></div></div><div class="refsect1"><a id="idm60"></a><h2>Notes</h2><p>There is a hardcoded limit of 100 the number of lines.</p></div><div class="refsect1"><a id="idm63"></a><h2>Author</h2><p>Gershon Elber.</p></div></div></body></html>
|
||||
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||
<refentry id='gifecho.1'>
|
||||
<refentryinfo><date>2 May 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>gifecho</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>gifecho</refname>
|
||||
<refpurpose>generate a GIF from ASCII text</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>gifecho</command>
|
||||
<arg choice='opt'>-v</arg>
|
||||
<arg choice='opt'>-s <replaceable>colormap-size</replaceable></arg>
|
||||
<arg choice='opt'>-f <replaceable>foreground</replaceable></arg>
|
||||
<arg choice='opt'>-c
|
||||
<replaceable>R</replaceable>
|
||||
<replaceable>G</replaceable>
|
||||
<replaceable>B</replaceable></arg>
|
||||
<arg choice='opt'>-t <replaceable>text</replaceable></arg>
|
||||
<arg choice='opt'>-h</arg>
|
||||
<arg choice='opt'><replaceable>gif-file</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
|
||||
<para>A program to generate GIF images out of regular text. Text can
|
||||
be one line or multi-line, and is converted using 8 by 8 fixed
|
||||
font.</para>
|
||||
|
||||
<para>This program reads stdin if no text is provided on the command line (-t),
|
||||
and will dump the created GIF file to stdout.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Options</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para>Verbose mode (show progress).
|
||||
Enables printout of running scan lines. </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-s colormap-size</term>
|
||||
<listitem>
|
||||
<para>Explicitly defines the size of the color map of the resulting gif image. Usually the image will be bicolor with fg as color 1, unless [-f] is explicitly given in case the color map size will be big enough to hold it. However it is sometimes convenient to set the color map size to certain size while the fg color is small mainly so this image may be merged with another (images must match color map size).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-f foreground</term>
|
||||
<listitem>
|
||||
<para> Select foreground index (background is always 0). By default it is one and therefore the image result is bicolored. if FG is set to n then color map will be created with 2^k entries where 2^k > n for minimum k, assuming k <= 8. This color map will be all zeros except this foreground index. This option is useful if this text image should be integrated into other image colormap using their colors.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-c R G B</term>
|
||||
<listitem>
|
||||
<para> The color to use as the foreground color. White by default.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-t text</term>
|
||||
<listitem>
|
||||
<para> One line of text can be provided on the command line. Note you must encapsulate the Text within quotes if it has spaces (The quotes themselves are not treated as part of the text). If no -t option is provided, stdin is read until end of file.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-h</term>
|
||||
<listitem>
|
||||
<para> Print one line command line help, similar to Usage above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Notes</title>
|
||||
|
||||
<para>There is a hardcoded limit of 100 the number of lines.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Author</title>
|
||||
|
||||
<para>Gershon Elber.</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
@@ -0,0 +1,53 @@
|
||||
'\" t
|
||||
.\" Title: giffix
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 2 May 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIFFIX" "1" "2 May 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
giffix \- attempt to fix up broken GIFs
|
||||
.SH "SYNOPSIS"
|
||||
.HP \w'\fBgiffix\fR\ 'u
|
||||
\fBgiffix\fR [\-v] [\-h] [\fIgif\-file\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
A program that attempts to fix broken GIF images\&. Currently will "fix" images terminated prematurely by filling the rest of the image with the darkest color found in the image\&.
|
||||
.PP
|
||||
If no GIF file is given, giffix will try to read a GIF file from stdin\&. The fixed file is dumped to stdout\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\-t
|
||||
.RS 4
|
||||
Verbose mode (show progress)\&. Enables printout of running scan lines\&.
|
||||
.RE
|
||||
.PP
|
||||
\-h
|
||||
.RS 4
|
||||
Print one line of command line help, similar to Usage above\&.
|
||||
.RE
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
Gershon Elber\&.
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>giffix</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="giffix.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>giffix — attempt to fix up broken GIFs</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">giffix</code> [-v] [-h] [<em class="replaceable"><code>gif-file</code></em>]</p></div></div><div class="refsect1"><a id="idm19"></a><h2>Description</h2><p>A program that attempts to fix broken GIF images. Currently will "fix"
|
||||
images terminated prematurely by filling the rest of the image with
|
||||
the darkest color found in the image.</p><p>If no GIF file is given, giffix will try to read a GIF file from
|
||||
stdin. The fixed file is dumped to stdout.</p></div><div class="refsect1"><a id="idm23"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-t</span></dt><dd><p>Verbose mode (show progress).
|
||||
Enables printout of running scan lines. </p></dd><dt><span class="term">-h</span></dt><dd><p>Print one line of command line help, similar to Usage
|
||||
above.</p></dd></dl></div></div><div class="refsect1"><a id="idm34"></a><h2>Author</h2><p>Gershon Elber.</p></div></div></body></html>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||
<refentry id='giffix.1'>
|
||||
<refentryinfo><date>2 May 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>giffix</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>giffix</refname>
|
||||
<refpurpose>attempt to fix up broken GIFs</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>giffix</command>
|
||||
<arg choice='opt'>-v</arg>
|
||||
<arg choice='opt'>-h</arg>
|
||||
<arg choice='opt'><replaceable>gif-file</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
|
||||
<para>A program that attempts to fix broken GIF images. Currently will "fix"
|
||||
images terminated prematurely by filling the rest of the image with
|
||||
the darkest color found in the image.</para>
|
||||
|
||||
<para>If no GIF file is given, giffix will try to read a GIF file from
|
||||
stdin. The fixed file is dumped to stdout.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Options</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-t</term>
|
||||
<listitem>
|
||||
<para>Verbose mode (show progress).
|
||||
Enables printout of running scan lines. </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-h</term>
|
||||
<listitem>
|
||||
<para>Print one line of command line help, similar to Usage
|
||||
above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Author</title>
|
||||
|
||||
<para>Gershon Elber.</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
@@ -0,0 +1,77 @@
|
||||
'\" t
|
||||
.\" Title: gifhisto
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 2 May 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIFHISTO" "1" "2 May 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
gifhisto \- make a color histogram from GIF colr frequencies
|
||||
.SH "SYNOPSIS"
|
||||
.HP \w'\fBgifhisto\fR\ 'u
|
||||
\fBgifhisto\fR [\-v] [\-t] [\-s\ \fIwidth\fR\ \fIheight\fR] [\-n\ \fIimage\-number\fR] [\-b] [\-h] [\fIgif\-file\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
A program to create histogram of number of pixels using each color\&. The output can be formatted into a GIF histogram file, or as text file \- both go to stdout\&.
|
||||
.PP
|
||||
If no GIF file is given, gifhisto will try to read a GIF file from stdin\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\-v
|
||||
.RS 4
|
||||
Verbose mode (show progress)\&. Enables printout of running scan lines\&.
|
||||
.RE
|
||||
.PP
|
||||
\-t
|
||||
.RS 4
|
||||
Force output to be text file of the following form: (colormap size) lines each containing two integers: number of times color appeared, and color index\&. Lines are in increasing color index order\&. This output can be fed directly to a sort program if ordering by color frequency is desired\&.
|
||||
.sp
|
||||
The colormap picked is the one to be used for the image to generate histogram for, as defined in GIF format\&.
|
||||
.RE
|
||||
.PP
|
||||
\-s width height
|
||||
.RS 4
|
||||
Size of GIF histogram file\&. The height of the histogram should be power of 2 dividable by number of colors in colormap\&.
|
||||
.sp
|
||||
Width sets the resolution (accuracy if you like) of the histogram as the maximum histogram bar is scaled to fit it\&.
|
||||
.RE
|
||||
.PP
|
||||
\-n image\-number
|
||||
.RS 4
|
||||
Image number to test\&. Default is one\&.
|
||||
.RE
|
||||
.PP
|
||||
\-b
|
||||
.RS 4
|
||||
Zeros the background color count\&. As only linear scale bars are supported and usually the background appears much more often then other colors, deleting the background count will improve the scaling of other colors\&.
|
||||
.RE
|
||||
.PP
|
||||
\-h
|
||||
.RS 4
|
||||
Print one line of command line help, similar to Usage above\&.
|
||||
.RE
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
Gershon Elber
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>gifhisto</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="gifhisto.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>gifhisto — make a color histogram from GIF colr frequencies</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">gifhisto</code> [-v] [-t] [-s
|
||||
<em class="replaceable"><code>width</code></em>
|
||||
<em class="replaceable"><code>height</code></em>] [-n <em class="replaceable"><code>image-number</code></em>] [-b] [-h] [<em class="replaceable"><code>gif-file</code></em>]</p></div></div><div class="refsect1"><a id="idm26"></a><h2>Description</h2><p>A program to create histogram of number of pixels using each
|
||||
color. The output can be formatted into a GIF histogram file, or as
|
||||
text file - both go to stdout.</p><p>If no GIF file is given, gifhisto will try to read a GIF file
|
||||
from stdin.</p></div><div class="refsect1"><a id="idm30"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><p>Verbose mode (show progress). Enables printout of running scan lines. </p></dd><dt><span class="term">-t</span></dt><dd><p>Force output to be text file of the following form: (colormap size) lines each containing two integers: number of times color appeared, and color index. Lines are in increasing color index order. This output can be fed directly to a sort program if ordering by color frequency is desired.</p><p>The colormap picked is the one to be used for the image to
|
||||
generate histogram for, as defined in GIF format.</p></dd><dt><span class="term">-s width height</span></dt><dd><p>Size of GIF histogram file. The height of the histogram should be power of 2 dividable by number of colors in colormap.</p><p>Width sets the resolution (accuracy if you like) of the histogram as
|
||||
the maximum histogram bar is scaled to fit it.</p></dd><dt><span class="term">-n image-number</span></dt><dd><p>Image number to test. Default is one.</p></dd><dt><span class="term">-b</span></dt><dd><p>Zeros the background color count. As only linear scale bars are
|
||||
supported and usually the background appears much more often then
|
||||
other colors, deleting the background count will improve the scaling
|
||||
of other colors.</p></dd><dt><span class="term">-h</span></dt><dd><p>Print one line of command line help, similar to Usage above.</p></dd></dl></div></div><div class="refsect1"><a id="idm59"></a><h2>Author</h2><p>Gershon Elber</p></div></div></body></html>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||
<refentry id='gifhisto.1'>
|
||||
<refentryinfo><date>2 May 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>gifhisto</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>gifhisto</refname>
|
||||
<refpurpose>make a color histogram from GIF colr frequencies</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>gifhisto</command>
|
||||
<arg choice='opt'>-v</arg>
|
||||
<arg choice='opt'>-t</arg>
|
||||
<arg choice='opt'>-s
|
||||
<replaceable>width</replaceable>
|
||||
<replaceable>height</replaceable></arg>
|
||||
<arg choice='opt'>-n <replaceable>image-number</replaceable></arg>
|
||||
<arg choice='opt'>-b</arg>
|
||||
<arg choice='opt'>-h</arg>
|
||||
<arg choice='opt'><replaceable>gif-file</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
|
||||
<para>A program to create histogram of number of pixels using each
|
||||
color. The output can be formatted into a GIF histogram file, or as
|
||||
text file - both go to stdout.</para>
|
||||
|
||||
<para>If no GIF file is given, gifhisto will try to read a GIF file
|
||||
from stdin.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Options</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para>Verbose mode (show progress). Enables printout of running scan lines. </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-t</term>
|
||||
<listitem>
|
||||
<para>Force output to be text file of the following form: (colormap size) lines each containing two integers: number of times color appeared, and color index. Lines are in increasing color index order. This output can be fed directly to a sort program if ordering by color frequency is desired.</para>
|
||||
<para>The colormap picked is the one to be used for the image to
|
||||
generate histogram for, as defined in GIF format.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-s width height</term>
|
||||
<listitem>
|
||||
<para>Size of GIF histogram file. The height of the histogram should be power of 2 dividable by number of colors in colormap.</para>
|
||||
<para>Width sets the resolution (accuracy if you like) of the histogram as
|
||||
the maximum histogram bar is scaled to fit it.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-n image-number</term>
|
||||
<listitem>
|
||||
<para>Image number to test. Default is one.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-b</term>
|
||||
<listitem>
|
||||
<para>Zeros the background color count. As only linear scale bars are
|
||||
supported and usually the background appears much more often then
|
||||
other colors, deleting the background count will improve the scaling
|
||||
of other colors.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-h</term>
|
||||
<listitem>
|
||||
<para>Print one line of command line help, similar to Usage above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Author</title>
|
||||
|
||||
<para>Gershon Elber</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
@@ -0,0 +1,60 @@
|
||||
'\" t
|
||||
.\" Title: gifinto
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 2 May 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIFINTO" "1" "2 May 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
gifinto \- save GIF on stdin to file if size over set threshold
|
||||
.SH "SYNOPSIS"
|
||||
.HP \w'\fBgifinto\fR\ 'u
|
||||
\fBgifinto\fR [\-v] [\-s\ \fIminsize\fR] [\-h] [\fIoutfile\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
A program to save stdin into a file with given name, iff the result file has size bigger than specified (see below)\&. This can be used to save a result under the same filename we started with in a chain of pipes\&.
|
||||
.PP
|
||||
Always reads a GIF file from stdin\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\-v
|
||||
.RS 4
|
||||
Verbose mode (show progress)\&. Enables printout of running scan lines\&.
|
||||
.RE
|
||||
.PP
|
||||
\-s MinFileSize
|
||||
.RS 4
|
||||
If file is less than MinFileSize, it is deleted and not renamed to the given name\&. This will prevent killing the file we started with if the result is an empty file, or the pipeline did not complete\&.
|
||||
.sp
|
||||
The default file threshold size is 14 bytes, which is 1 bigger than GIF file stamp (6 bytes) plus a GIF file screen descriptor (7 bytes), so a GIF file with only GIF stamp and screen descriptor will not be renamed\&.
|
||||
.RE
|
||||
.PP
|
||||
\-h
|
||||
.RS 4
|
||||
Print one line of command line help, similar to Usage above\&.
|
||||
.RE
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
Gershon Elber\&.
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>gifinto</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="gifinto.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>gifinto — save GIF on stdin to file if size over set threshold</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">gifinto</code> [-v] [-s <em class="replaceable"><code>minsize</code></em>] [-h] [<em class="replaceable"><code>outfile</code></em>]</p></div></div><div class="refsect1"><a id="idm21"></a><h2>Description</h2><p>A program to save stdin into a file with given name, iff the
|
||||
result file has size bigger than specified (see below). This can be
|
||||
used to save a result under the same filename we started with in a
|
||||
chain of pipes.</p><p>Always reads a GIF file from stdin.</p></div><div class="refsect1"><a id="idm25"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><p>Verbose mode (show progress).
|
||||
Enables printout of running scan lines.</p></dd><dt><span class="term">-s MinFileSize</span></dt><dd><p>If file is less than MinFileSize, it is deleted and not renamed
|
||||
to the given name. This will prevent killing the file we started with if
|
||||
the result is an empty file, or the pipeline did not
|
||||
complete.</p><p>The default file threshold size is 14 bytes, which is 1 bigger
|
||||
than GIF file stamp (6 bytes) plus a GIF file screen descriptor (7
|
||||
bytes), so a GIF file with only GIF stamp and screen descriptor will
|
||||
not be renamed.</p></dd><dt><span class="term">-h</span></dt><dd><p>Print one line of command line help, similar to Usage above.</p></dd></dl></div></div><div class="refsect1"><a id="idm41"></a><h2>Author</h2><p>Gershon Elber.</p></div></div></body></html>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||
<refentry id='gifinto.1'>
|
||||
<refentryinfo><date>2 May 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>gifinto</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>gifinto</refname>
|
||||
<refpurpose>save GIF on stdin to file if size over set threshold</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>gifinto</command>
|
||||
<arg choice='opt'>-v</arg>
|
||||
<arg choice='opt'>-s <replaceable>minsize</replaceable></arg>
|
||||
<arg choice='opt'>-h</arg>
|
||||
<group><replaceable>outfile</replaceable></group>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
|
||||
<para>A program to save stdin into a file with given name, iff the
|
||||
result file has size bigger than specified (see below). This can be
|
||||
used to save a result under the same filename we started with in a
|
||||
chain of pipes.</para>
|
||||
|
||||
<para>Always reads a GIF file from stdin.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Options</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para>Verbose mode (show progress).
|
||||
Enables printout of running scan lines.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-s MinFileSize</term>
|
||||
<listitem>
|
||||
<para>If file is less than MinFileSize, it is deleted and not renamed
|
||||
to the given name. This will prevent killing the file we started with if
|
||||
the result is an empty file, or the pipeline did not
|
||||
complete.</para>
|
||||
<para>The default file threshold size is 14 bytes, which is 1 bigger
|
||||
than GIF file stamp (6 bytes) plus a GIF file screen descriptor (7
|
||||
bytes), so a GIF file with only GIF stamp and screen descriptor will
|
||||
not be renamed.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>-h</term>
|
||||
<listitem>
|
||||
<para>Print one line of command line help, similar to Usage above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Author</title>
|
||||
|
||||
<para>Gershon Elber.</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
@@ -0,0 +1,52 @@
|
||||
'\" t
|
||||
.\" Title: giflib
|
||||
.\" Author: [see the "Authors" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 3 June 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIFLIB" "1" "3 June 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
giflib \- GIFLIB utilities
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
GIFLIB is a linkable service library and a set of utilities for processing images encoded using GIF (Graphics Interchange Format)\&.
|
||||
.PP
|
||||
These utilities are not intended to compete with or replace multi\-format graphics toolkits like ImageMagick or the Python Imaging Library, or graphics editors such as the GIMP\&. Find one of those, or an equivalent, if you need to crop, scale, rotate, toggle interlacing, or perform other conventional image transformations\&. Rather, these are intended to facilitate GIF\-specific operations which multi\-format tools may not adequately support\&.
|
||||
.PP
|
||||
API documentation for the service library is best viewed through a browser at the project website: http://sourceforge\&.net/projects/giflib/?source=directory\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fBgif2raw\fR(1),
|
||||
\fBgif2rgb\fR(1),
|
||||
\fBgifbuild\fR(1),
|
||||
\fBgifecho\fR(1),
|
||||
\fBgiffix\fR(1),
|
||||
\fBgifinto\fR(1),
|
||||
\fBgiftext\fR(1),
|
||||
\fBgiftool\fR(1),
|
||||
\fBgifclrmap\fR(1)\&.
|
||||
.SH "AUTHORS"
|
||||
.PP
|
||||
Gershon Elber, Eric S\&. Raymond, Toshio Kuratomi\&.
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>giflib</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="giflib.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>giflib — GIFLIB utilities</p></div><div class="refsect1"><a id="idm12"></a><h2>Description</h2><p>GIFLIB is a linkable service library and a set of utilities for
|
||||
processing images encoded using GIF (Graphics Interchange Format).</p><p>These utilities are not intended to compete with or replace
|
||||
multi-format graphics toolkits like ImageMagick or the Python Imaging
|
||||
Library, or graphics editors such as the GIMP. Find one of those, or
|
||||
an equivalent, if you need to crop, scale, rotate, toggle interlacing,
|
||||
or perform other conventional image transformations. Rather, these are
|
||||
intended to facilitate GIF-specific operations which multi-format tools
|
||||
may not adequately support.</p><p>API documentation for the service library is best viewed through
|
||||
a browser at the project website: http://sourceforge.net/projects/giflib/?source=directory.</p></div><div class="refsect1"><a id="idm17"></a><h2>See Also</h2><p>
|
||||
<span class="citerefentry"><span class="refentrytitle">gif2raw</span>(1)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">gif2rgb</span>(1)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">gifbuild</span>(1)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">gifecho</span>(1)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">giffix</span>(1)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">gifinto</span>(1)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">giftext</span>(1)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">giftool</span>(1)</span>,
|
||||
<span class="citerefentry"><span class="refentrytitle">gifclrmap</span>(1)</span>.
|
||||
</p></div><div class="refsect1"><a id="idm47"></a><h2>Authors</h2><p>Gershon Elber, Eric S. Raymond, Toshio Kuratomi.</p></div></div></body></html>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
||||
<!ENTITY project "http://sourceforge.net/projects/giflib/?source=directory">
|
||||
]>
|
||||
<refentry id='giflib.1'>
|
||||
<refentryinfo><date>3 June 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>giflib</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>giflib</refname>
|
||||
<refpurpose>GIFLIB utilities</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
|
||||
<para>GIFLIB is a linkable service library and a set of utilities for
|
||||
processing images encoded using GIF (Graphics Interchange Format).</para>
|
||||
|
||||
<para>These utilities are not intended to compete with or replace
|
||||
multi-format graphics toolkits like ImageMagick or the Python Imaging
|
||||
Library, or graphics editors such as the GIMP. Find one of those, or
|
||||
an equivalent, if you need to crop, scale, rotate, toggle interlacing,
|
||||
or perform other conventional image transformations. Rather, these are
|
||||
intended to facilitate GIF-specific operations which multi-format tools
|
||||
may not adequately support.</para>
|
||||
|
||||
<para>API documentation for the service library is best viewed through
|
||||
a browser at the project website: &project;.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>See Also</title>
|
||||
|
||||
<para>
|
||||
<citerefentry><refentrytitle>gif2raw</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
<citerefentry><refentrytitle>gif2rgb</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
<citerefentry><refentrytitle>gifbuild</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
<citerefentry><refentrytitle>gifecho</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
<citerefentry><refentrytitle>giffix</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
<citerefentry><refentrytitle>gifinto</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
<citerefentry><refentrytitle>giftext</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
<citerefentry><refentrytitle>giftool</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
<citerefentry><refentrytitle>gifclrmap</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Authors</title>
|
||||
|
||||
<para>Gershon Elber, Eric S. Raymond, Toshio Kuratomi.</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
@@ -0,0 +1,352 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>An Introduction to Data Compression</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>LZW and GIF explained<br>
|
||||
<font size="-1">by Steve Blackstock</font>
|
||||
</h1>
|
||||
|
||||
<p>I hope this little document will help enlighten those of you out there
|
||||
who want to know more about the Lempel-Ziv Welch (LZW) compression algorithm, and,
|
||||
specifically, the implementation that GIF uses.</p>
|
||||
|
||||
<p>Before we start, here's a little terminology, for the purposes of this
|
||||
document:</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<strong>character</strong>: a fundamental data element. In normal text files, this is
|
||||
just a single byte. In raster images, which is what we're interested in, it's
|
||||
an index that specifies the color of a given pixel. I'll refer to an arbitray
|
||||
character as "K".
|
||||
</li><li>
|
||||
<strong>charstream</strong>: a stream of characters, as in a data file.
|
||||
</li><li>
|
||||
<strong>string</strong>: a number of continuous characters, anywhere from one to very
|
||||
many characters in length. I can specify an arbitrary string as "[...]K".
|
||||
</li><li>
|
||||
<strong>prefix</strong>: almost the same as a string, but with the implication that a
|
||||
prefix immediately precedes a character, and a prefix can have a length of
|
||||
zero. So, a prefix and a character make up a string. I will refer to an
|
||||
arbitrary prefix as "[...]".
|
||||
</li><li>
|
||||
<strong>root</strong>: a single-character string. For most purposes, this is a
|
||||
character, but we may occasionally make a distinction. It is [...]K, where
|
||||
[...] is empty.
|
||||
</li><li>
|
||||
<strong>code</strong>: a number, specified by a known number of bits, which maps to a
|
||||
string.
|
||||
</li><li>
|
||||
<strong>codestream</strong>: the output stream of codes, as in the "raster data"
|
||||
</li><li>
|
||||
<strong>entry</strong>: a code and its string.
|
||||
</li><li>
|
||||
<strong>string table</strong>: a list of entries; usually, but not necessarily, unique.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
LZW is a way of compressing data that takes advantage of repetition of
|
||||
strings in the data. Since raster data usually contains a lot of this
|
||||
repetition, LZW is a good way of compressing and decompressing it.
|
||||
For the moment, lets consider normal LZW encoding and decoding. GIF's
|
||||
variation on the concept is just an extension from there.
|
||||
|
||||
</p><p>
|
||||
LZW manipulates three objects in both compression and decompression: the
|
||||
charstream, the codestream, and the string table. In compression, the
|
||||
charstream is the input and the codestream is the output. In decompression,
|
||||
the codestream is the input and the charstream is the output. The string table
|
||||
is a product of both compression and decompression, but is never passed from
|
||||
one to the other.
|
||||
|
||||
</p><h2>Compression</h2>
|
||||
|
||||
<p>
|
||||
The first thing we do in LZW compression is initialize our string table.
|
||||
To do this, we need to choose a code size (how many bits) and know how many
|
||||
values our characters can possibly take. Let's say our code size is 12 bits,
|
||||
meaning we can store 0->FFF, or 4096 entries in our string table. Lets also
|
||||
say that we have 32 possible different characters. (This corresponds to, say,
|
||||
a picture in which there are 32 different colors possible for each pixel.) To
|
||||
initialize the table, we set code#0 to character#0, code #1 to character#1,
|
||||
and so on, until code#31 to character#31. Actually, we are specifying that
|
||||
each code from 0 to 31 maps to a root. There will be no more entries in the
|
||||
table that have this property.
|
||||
|
||||
</p><p>
|
||||
|
||||
Now we start compressing data. Let's first define something
|
||||
called the "current prefix". It's just a prefix that we'll store
|
||||
things in and compare things to now and then. I will refer to it as
|
||||
"[.c.]". Initially, the current prefix has nothing in it. Let's also
|
||||
define a "current string", which will be the current prefix plus the
|
||||
next character in the charstream. I will refer to the current string
|
||||
as "[.c.]K", where K is some character. OK, look at the first
|
||||
character in the charstream. Call it P. Make [.c.]P the current
|
||||
string. (At this point, of course, it's just the root P.) Now search
|
||||
through the string table to see if [.c.]P appears in it. Of course, it
|
||||
does now, because our string table is initialized to have all roots.
|
||||
So we don't do anything. Now make [.c.]P the current prefix. Look at
|
||||
the next character in the charstream. Call it Q. Add it to the
|
||||
current prefix to form [.c.]Q, the current string. Now search through
|
||||
the string table to see if [.c.]Q appears in it. In this case, of
|
||||
course, it doesn't. Aha! Now we get to do something. Add [.c.]Q
|
||||
(which is PQ in this case) to the string table for code#32, and output
|
||||
the code for [.c.] to the codestream. Now start over again with the
|
||||
current prefix being just the root Q. Keep adding characters to [.c.]
|
||||
to form [.c.]K, until you can't find [.c.]K in the string table. Then
|
||||
output the code for [.c.] and add [.c.]K to the string table. In
|
||||
pseudo-code, the algorithm goes something like this:
|
||||
|
||||
</p><pre> [1] Initialize string table;
|
||||
[2] [.c.] <- empty;
|
||||
[3] K <- next character in charstream;
|
||||
[4] Is [.c.]K in string table?
|
||||
(yes: [.c.] <- [.c.]K;
|
||||
go to [3];
|
||||
)
|
||||
(no: add [.c.]K to the string table;
|
||||
output the code for [.c.] to the codestream;
|
||||
[.c.] <- K;
|
||||
go to [3];
|
||||
)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
It's as simple as that! Of course, when you get to step [3] and there
|
||||
aren't any more characters left, you just output the code for [.c.] and throw
|
||||
the table away. You're done.
|
||||
|
||||
</p><p>
|
||||
Wanna do an example? Let's pretend we have a four-character alphabet:
|
||||
A,B,C,D. The charstream looks like ABACABA. Let's compress it. First, we
|
||||
initialize our string table to: #0=A, #1=B, #2=C, #3=D. The first character is
|
||||
A, which is in the string table, so [.c.] becomes A. Next we get AB, which is
|
||||
not in the table, so we output code #0 (for [.c.]),
|
||||
and add AB to the string table as code #4. [.c.] becomes B. Next we get
|
||||
[.c.]A = BA, which is not in the string table, so output code #1, and add BA
|
||||
to the string table as code #5. [.c.] becomes A. Next we get AC, which is not
|
||||
in the string table. Output code #0, and add AC to the string table as code
|
||||
#6. Now [.c.] becomes C. Next we get [.c.]A = CA, which is not in the table.
|
||||
Output #2 for C, and add CA to table as code#7. Now [.c.] becomes A. Next we
|
||||
get AB, which IS in the string table, so [.c.] gets AB, and we look at ABA,
|
||||
which is not in the string table, so output the code for AB, which is #4, and
|
||||
add ABA to the string table as code #8. [.c.] becomes A. We can't get any more
|
||||
characters, so we just output #0 for the code for A, and we're done. So, the
|
||||
codestream is #0#1#0#2#4#0.
|
||||
|
||||
</p><p>
|
||||
A few words (four) should be said here about efficiency: use a hashing
|
||||
strategy. The search through the string table can be computationally
|
||||
intensive, and some hashing is well worth the effort. Also, note that
|
||||
"straight LZW" compression runs the risk of overflowing the string table -
|
||||
getting to a code which can't be represented in the number of bits you've set
|
||||
aside for codes. There are several ways of dealing with this problem, and GIF
|
||||
implements a very clever one, but we'll get to that.
|
||||
|
||||
</p><p>
|
||||
An important thing to notice is that, at any point during the
|
||||
compression, if [...]K is in the string table, [...] is there also. This fact
|
||||
suggests an efficient method for storing strings in the table. Rather than
|
||||
store the entire string of K's in the table, realize that any string can be
|
||||
expressed as a prefix plus a character: [...]K. If we're about to store [...]K
|
||||
in the table, we know that [...] is already there, so we can just store the
|
||||
code for [...] plus the final character K.
|
||||
|
||||
|
||||
</p><h2>Decompression</h2>
|
||||
|
||||
Decompression is perhaps more
|
||||
difficult conceptually, but it is really easier to program.
|
||||
We again have to start with an initialized string
|
||||
table. This table comes from what knowledge we have about the charstream that
|
||||
we will eventually get, like what possible values the characters can take. In
|
||||
GIF files, this information is in the header as the number of possible pixel
|
||||
values. The beauty of LZW, though, is that this is all we need to know. We
|
||||
will build the rest of the string table as we decompress the codestream. The
|
||||
compression is done in such a way that we will never encounter a code in the
|
||||
codestream that we can't translate into a string.
|
||||
|
||||
<p>
|
||||
We need to define something called a "current code", which I
|
||||
will refer to as "<code>", and an "old-code", which I will refer
|
||||
to as "<old>". To start things off, look at the first code. This
|
||||
is now <code>. This code will be in the intialized string table as
|
||||
the code for a root. Output the root to the charstream. Make this code
|
||||
the old-code <old>. *Now look at the next code, and make it
|
||||
<code>. It is possible that this code will not be in the string
|
||||
table, but let's assume for now that it is. Output the string
|
||||
corresponding to <code> to the codestream. Now find the first
|
||||
character in the string you just translated. Call this K. Add this to
|
||||
the prefix [...] generated by <old> to form a new string
|
||||
[...]K. Add this string [...]K to the string table, and set the
|
||||
old-code <old> to the current code <code>. Repeat from where I
|
||||
typed the asterisk, and you're all set.
|
||||
This is the most common case so you should understand this before going
|
||||
on.
|
||||
|
||||
</p><p>
|
||||
|
||||
Now let's consider the possibility that <code> is not in the
|
||||
string table, which as we will see can only occur for strings of the
|
||||
form P[...]P (for any character P). Think back to compression, and
|
||||
try to understand what happens when you have a string like
|
||||
P[...]P[...]PQ appear in the charstream. Suppose P[...] is already in
|
||||
the string table, but P[...]P is not. The compressor will parse out
|
||||
P[...], and find that P[...]P is not in the string table. It will
|
||||
output the code for P[...], and add P[...]P to the string table. Then
|
||||
it will get up to P[...]P for the next string, and find that P[...]P
|
||||
is in the table, as the code just added. So it will output the code
|
||||
for P[...]P if it finds that P[...]PQ is not in the table. The
|
||||
decompressor is always "one step behind" the compressor. When the
|
||||
decompressor sees the code for P[...]P, it will not have added that
|
||||
code to it's string table yet because it needed the beginning
|
||||
character of P[...]P to add to the string for the last code, P[...],
|
||||
to form the code for P[...]P. However, when a decompressor finds a
|
||||
code that it doesn't know yet, it will always be the very next one to
|
||||
be added to the string table. So it can guess at what the string for
|
||||
the code should be, and, in fact, it will always be correct. If I am a
|
||||
decompressor, and I see code#124, and yet my string table has entries
|
||||
only up to code#123, I can figure out what code#124 must be, add it to
|
||||
my string table, and output the string. If code#123 generated the
|
||||
string [...], which I will refer to here as a prefix, then code#124,
|
||||
in this special case, will be [...] plus the first character of [...].
|
||||
So just add the first character of [...] to the end of itself. Not
|
||||
too bad.
|
||||
|
||||
|
||||
</p><p>
|
||||
|
||||
As an example (and a very common one) of this special case, let's
|
||||
assume we have a raster image in which the first three pixels have the
|
||||
same color value. That is, my charstream looks like: QQQ.... For the
|
||||
sake of argument, let's say we have 32 colors, and Q is the
|
||||
color#12. The compressor will generate the code sequence
|
||||
12,32,.... (if you don't know why, take a minute to understand it.)
|
||||
Remember that #32 is not in the initial table, which goes from #0 to
|
||||
#31. The decompressor will see #12 and translate it just fine as color
|
||||
Q. Then it will see #32 and not yet know what that means. But if it
|
||||
thinks about it long enough, it can figure out that QQ should be
|
||||
entry#32 in the table and QQ should be the next string output. So the
|
||||
decompression pseudo-code goes something like:
|
||||
|
||||
</p><pre> [1] Initialize string table;
|
||||
[2] get first code: <code>
|
||||
[3] output the string for <code> to the charstream;
|
||||
[4] <old> = <code>
|
||||
[5] <code> <- next code in codestream;
|
||||
[6] does <code> exist in the string table?
|
||||
(yes: output the string for <code> to the charstream;
|
||||
[...] <- translation for <old>
|
||||
K <- first character of translation for <code>
|
||||
add [...]K to the string table;
|
||||
<old> <- <code>
|
||||
)
|
||||
(no: [...] <- translation for <old>
|
||||
K <- first character of [...];
|
||||
output [...]K to charstream and add it to string table;
|
||||
<old> <- <code>
|
||||
)
|
||||
[7] go to [5];
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Again, when you get to step [5] and there are no more codes, you're
|
||||
finished. Outputting of strings, and finding of initial characters in strings
|
||||
are efficiency problems all to themselves, but I'm not going to suggest ways
|
||||
to do them here. Half the fun of programming is figuring these things out!
|
||||
|
||||
</p><h2>GIF variation</h2>
|
||||
|
||||
<p>
|
||||
|
||||
Now for the GIF variations on the theme. In part of the header of a
|
||||
GIF file, there is a field, in the Raster Data stream, called "code
|
||||
size". This is a very misleading name for the field, but we have to
|
||||
live with it. What it is really is the "root size". The actual size,
|
||||
in bits, of the compression codes actually changes during
|
||||
compression/decompression, and I will refer to that size here as the
|
||||
"compression size". The initial table is just the codes for all the
|
||||
roots, as usual, but two special codes are added on top of those. The
|
||||
"code size" N is set to max(2,bits-per-pixel). In the table the roots
|
||||
take up slots #0 through #(2**N-1), and the special codes are (2**N)
|
||||
and (2**N + 1). The initial compression size will be N+1 bits per
|
||||
code. If you're encoding, you output the codes (N+1) bits at a time to
|
||||
start with, and if you're decoding, you grab (N+1) bits from the
|
||||
codestream at a time. As for the special codes: <CC> or the clear
|
||||
code, is (2**N), and <EOI>, or end-of-information, is (2**N +
|
||||
1). <CC> tells the compressor to re- initialize the string table,
|
||||
and to reset the compression size to (N+1). <EOI> means there's no
|
||||
more in the codestream.
|
||||
|
||||
</p><p>
|
||||
|
||||
If you're encoding or decoding, you should
|
||||
start adding things to the string table at <CC> + 2. If you're
|
||||
encoding, you should output <CC> as the very first code, and then
|
||||
whenever after that you reach code #4095 (hex FFF), because GIF does
|
||||
not allow compression sizes to be greater than 12 bits. If you're
|
||||
decoding, you should reinitialize your string table when you observe
|
||||
<CC>. The variable compression sizes are really no big deal. If
|
||||
you're encoding, you start with a compression size of (N+1) bits, and,
|
||||
whenever you output the code (2**(compression size)-1), you bump the
|
||||
compression size up one bit. So the next code you output will be one
|
||||
bit longer. Remember that the largest compression size is 12 bits,
|
||||
corresponding to a code of 4095. If you get that far, you must output
|
||||
<CC> as the next code, and start over. If you're decoding, you
|
||||
must increase your compression size AS SOON AS YOU write entry
|
||||
#(2**(compression size) - 1) to the string table. The next code you
|
||||
READ will be one bit longer. Don't make the mistake of waiting until
|
||||
you need to add the code (2**compression size) to the table. You'll
|
||||
have already missed a bit from the last code. The packaging of codes
|
||||
into a bitsream for the raster data is also a potential stumbling
|
||||
block for the novice encoder or decoder. The lowest order bit in the
|
||||
code should coincide with the lowest available bit in the first
|
||||
available byte in the codestream. For example, if you're starting with
|
||||
5-bit compression codes, and your first three codes are, say,
|
||||
<abcde>, <fghij>, <klmno>, where e, j, and o are bit#0,
|
||||
then your codestream will start off like:
|
||||
|
||||
</p><pre> byte#0: hijabcde
|
||||
byte#1: .klmnofg
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
|
||||
So the differences between straight LZW and GIF LZW are: two additional
|
||||
special codes and variable compression sizes. If you understand LZW, and you
|
||||
understand those variations, you understand it all!
|
||||
|
||||
</p><p>
|
||||
Just as sort of a P.S., you may have noticed that a compressor has a
|
||||
little bit of flexibility at compression time. I specified a "greedy" approach
|
||||
to the compression, grabbing as many characters as possible before outputting
|
||||
codes. This is, in fact, the standard LZW way of doing things, and it will
|
||||
yield the best compression ratio. But there's no rule saying you can't stop
|
||||
anywhere along the line and just output the code for the current prefix,
|
||||
whether it's already in the table or not, and add that string plus the next
|
||||
character to the string table. There are various reasons for wanting to do
|
||||
this, especially if the strings get extremely long and make hashing difficult.
|
||||
If you need to, do it.
|
||||
|
||||
</p><p>
|
||||
Hope this helps out.----steve blackstock
|
||||
|
||||
</p><h3>Further information</h3>
|
||||
|
||||
The original paper that describes the LZW algorithm is:
|
||||
|
||||
<blockquote>
|
||||
Terry A. Welch.
|
||||
A Technique for High Performance Data Compression.
|
||||
IEEE Computer, Vol. 17, No. 6, 1984, pp. 8-19.
|
||||
</blockquote>
|
||||
|
||||
The GIF format is described in more detail in the
|
||||
<a href="gif87.txt">GIF87(5) - GIF 87</a> and
|
||||
<a href="gif89.txt">GIF89a(5) - GIF 89a</a> standards.
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 311 B |
|
After Width: | Height: | Size: 301 B |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,680 @@
|
||||
|
||||
|
||||
|
||||
|
||||
G I F (tm)
|
||||
|
||||
Graphics Interchange Format (tm)
|
||||
|
||||
A standard defining a mechanism
|
||||
for the storage and transmission
|
||||
of raster-based graphics information
|
||||
|
||||
June 15, 1987
|
||||
|
||||
(c) CompuServe Incorporated, 1987
|
||||
All rights reserved
|
||||
|
||||
While this document is copyrighted, the information
|
||||
contained within is made available for use in computer
|
||||
software without royalties, or licensing restrictions.
|
||||
GIF and 'Graphics Interchange Format' are trademarks of
|
||||
|
||||
CompuServe, Incorporated.
|
||||
an H&R Block Company
|
||||
5000 Arlington Centre Blvd.
|
||||
Columbus, Ohio 43220
|
||||
(614) 457-8600
|
||||
|
||||
Page 2
|
||||
|
||||
|
||||
|
||||
Graphics Interchange Format (GIF) Specification
|
||||
Table of Contents
|
||||
INTRODUCTION . . . . . . . . . . . . . . . . . page 3
|
||||
GENERAL FILE FORMAT . . . . . . . . . . . . . page 3
|
||||
GIF SIGNATURE . . . . . . . . . . . . . . . . page 4
|
||||
SCREEN DESCRIPTOR . . . . . . . . . . . . . . page 4
|
||||
GLOBAL COLOR MAP . . . . . . . . . . . . . . . page 5
|
||||
IMAGE DESCRIPTOR . . . . . . . . . . . . . . . page 6
|
||||
LOCAL COLOR MAP . . . . . . . . . . . . . . . page 7
|
||||
RASTER DATA . . . . . . . . . . . . . . . . . page 7
|
||||
GIF TERMINATOR . . . . . . . . . . . . . . . . page 8
|
||||
GIF EXTENSION BLOCKS . . . . . . . . . . . . . page 8
|
||||
APPENDIX A - GLOSSARY . . . . . . . . . . . . page 9
|
||||
APPENDIX B - INTERACTIVE SEQUENCES . . . . . . page 10
|
||||
APPENDIX C - IMAGE PACKAGING & COMPRESSION . . page 12
|
||||
APPENDIX D - MULTIPLE IMAGE PROCESSING . . . . page 15
|
||||
|
||||
Graphics Interchange Format (GIF) Page 3
|
||||
|
||||
|
||||
|
||||
Specification
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
'GIF' (tm) is CompuServe's standard for defining generalized color
|
||||
raster images. This 'Graphics Interchange Format' (tm) allows
|
||||
high-quality, high-resolution graphics to be displayed on a variety of
|
||||
graphics hardware and is intended as an exchange and display mechanism
|
||||
for graphics images. The image format described in this document is
|
||||
designed to support current and future image technology and will in
|
||||
addition serve as a basis for future CompuServe graphics products.
|
||||
|
||||
The main focus of this document is to provide the technical
|
||||
information necessary for a programmer to implement GIF encoders and
|
||||
decoders. As such, some assumptions are made as to terminology relavent
|
||||
to graphics and programming in general.
|
||||
|
||||
The first section of this document describes the GIF data format
|
||||
and its components and applies to all GIF decoders, either as standalone
|
||||
programs or as part of a communications package. Appendix B is a
|
||||
section relavent to decoders that are part of a communications software
|
||||
package and describes the protocol requirements for entering and exiting
|
||||
GIF mode, and responding to host interrogations. A glossary in Appendix
|
||||
A defines some of the terminology used in this document. Appendix C
|
||||
gives a detailed explanation of how the graphics image itself is
|
||||
packaged as a series of data bytes.
|
||||
|
||||
|
||||
Graphics Interchange Format Data Definition
|
||||
|
||||
GENERAL FILE FORMAT
|
||||
|
||||
+-----------------------+
|
||||
| +-------------------+ |
|
||||
| | GIF Signature | |
|
||||
| +-------------------+ |
|
||||
| +-------------------+ |
|
||||
| | Screen Descriptor | |
|
||||
| +-------------------+ |
|
||||
| +-------------------+ |
|
||||
| | Global Color Map | |
|
||||
| +-------------------+ |
|
||||
. . . . . .
|
||||
| +-------------------+ | ---+
|
||||
| | Image Descriptor | | |
|
||||
| +-------------------+ | |
|
||||
| +-------------------+ | |
|
||||
| | Local Color Map | | |- Repeated 1 to n times
|
||||
| +-------------------+ | |
|
||||
| +-------------------+ | |
|
||||
| | Raster Data | | |
|
||||
| +-------------------+ | ---+
|
||||
. . . . . .
|
||||
|- GIF Terminator -|
|
||||
+-----------------------+
|
||||
|
||||
Graphics Interchange Format (GIF) Page 4
|
||||
|
||||
|
||||
|
||||
Specification
|
||||
|
||||
GIF SIGNATURE
|
||||
|
||||
The following GIF Signature identifies the data following as a
|
||||
valid GIF image stream. It consists of the following six characters:
|
||||
|
||||
G I F 8 7 a
|
||||
|
||||
The last three characters '87a' may be viewed as a version number
|
||||
for this particular GIF definition and will be used in general as a
|
||||
reference in documents regarding GIF that address any version
|
||||
dependencies.
|
||||
|
||||
SCREEN DESCRIPTOR
|
||||
|
||||
The Screen Descriptor describes the overall parameters for all GIF
|
||||
images following. It defines the overall dimensions of the image space
|
||||
or logical screen required, the existance of color mapping information,
|
||||
background screen color, and color depth information. This information
|
||||
is stored in a series of 8-bit bytes as described below.
|
||||
|
||||
bits
|
||||
7 6 5 4 3 2 1 0 Byte #
|
||||
+---------------+
|
||||
| | 1
|
||||
+-Screen Width -+ Raster width in pixels (LSB first)
|
||||
| | 2
|
||||
+---------------+
|
||||
| | 3
|
||||
+-Screen Height-+ Raster height in pixels (LSB first)
|
||||
| | 4
|
||||
+-+-----+-+-----+ M = 1, Global color map follows Descriptor
|
||||
|M| cr |0|pixel| 5 cr+1 = # bits of color resolution
|
||||
+-+-----+-+-----+ pixel+1 = # bits/pixel in image
|
||||
| background | 6 background=Color index of screen background
|
||||
+---------------+ (color is defined from the Global color
|
||||
|0 0 0 0 0 0 0 0| 7 map or default map if none specified)
|
||||
+---------------+
|
||||
|
||||
The logical screen width and height can both be larger than the
|
||||
physical display. How images larger than the physical display are
|
||||
handled is implementation dependent and can take advantage of hardware
|
||||
characteristics (e.g. Macintosh scrolling windows). Otherwise images
|
||||
can be clipped to the edges of the display.
|
||||
|
||||
The value of 'pixel' also defines the maximum number of colors
|
||||
within an image. The range of values for 'pixel' is 0 to 7 which
|
||||
represents 1 to 8 bits. This translates to a range of 2 (B & W) to 256
|
||||
colors. Bit 3 of word 5 is reserved for future definition and must be
|
||||
zero.
|
||||
|
||||
Graphics Interchange Format (GIF) Page 5
|
||||
|
||||
|
||||
|
||||
Specification
|
||||
|
||||
GLOBAL COLOR MAP
|
||||
|
||||
The Global Color Map is optional but recommended for images where
|
||||
accurate color rendition is desired. The existence of this color map is
|
||||
indicated in the 'M' field of byte 5 of the Screen Descriptor. A color
|
||||
map can also be associated with each image in a GIF file as described
|
||||
later. However this global map will normally be used because of
|
||||
hardware restrictions in equipment available today. In the individual
|
||||
Image Descriptors the 'M' flag will normally be zero. If the Global
|
||||
Color Map is present, it's definition immediately follows the Screen
|
||||
Descriptor. The number of color map entries following a Screen
|
||||
Descriptor is equal to 2**(# bits per pixel), where each entry consists
|
||||
of three byte values representing the relative intensities of red, green
|
||||
and blue respectively. The structure of the Color Map block is:
|
||||
|
||||
bits
|
||||
7 6 5 4 3 2 1 0 Byte #
|
||||
+---------------+
|
||||
| red intensity | 1 Red value for color index 0
|
||||
+---------------+
|
||||
|green intensity| 2 Green value for color index 0
|
||||
+---------------+
|
||||
| blue intensity| 3 Blue value for color index 0
|
||||
+---------------+
|
||||
| red intensity | 4 Red value for color index 1
|
||||
+---------------+
|
||||
|green intensity| 5 Green value for color index 1
|
||||
+---------------+
|
||||
| blue intensity| 6 Blue value for color index 1
|
||||
+---------------+
|
||||
: : (Continues for remaining colors)
|
||||
|
||||
Each image pixel value received will be displayed according to its
|
||||
closest match with an available color of the display based on this color
|
||||
map. The color components represent a fractional intensity value from
|
||||
none (0) to full (255). White would be represented as (255,255,255),
|
||||
black as (0,0,0) and medium yellow as (180,180,0). For display, if the
|
||||
device supports fewer than 8 bits per color component, the higher order
|
||||
bits of each component are used. In the creation of a GIF color map
|
||||
entry with hardware supporting fewer than 8 bits per component, the
|
||||
component values for the hardware should be converted to the 8-bit
|
||||
format with the following calculation:
|
||||
|
||||
<map_value> = <component_value>*255/(2**<nbits> -1)
|
||||
|
||||
This assures accurate translation of colors for all displays. In
|
||||
the cases of creating GIF images from hardware without color palette
|
||||
capability, a fixed palette should be created based on the available
|
||||
display colors for that hardware. If no Global Color Map is indicated,
|
||||
a default color map is generated internally which maps each possible
|
||||
incoming color index to the same hardware color index modulo <n> where
|
||||
<n> is the number of available hardware colors.
|
||||
|
||||
Graphics Interchange Format (GIF) Page 6
|
||||
|
||||
|
||||
|
||||
Specification
|
||||
|
||||
IMAGE DESCRIPTOR
|
||||
|
||||
The Image Descriptor defines the actual placement and extents of
|
||||
the following image within the space defined in the Screen Descriptor.
|
||||
Also defined are flags to indicate the presence of a local color lookup
|
||||
map, and to define the pixel display sequence. Each Image Descriptor is
|
||||
introduced by an image separator character. The role of the Image
|
||||
Separator is simply to provide a synchronization character to introduce
|
||||
an Image Descriptor. This is desirable if a GIF file happens to contain
|
||||
more than one image. This character is defined as 0x2C hex or ','
|
||||
(comma). When this character is encountered between images, the Image
|
||||
Descriptor will follow immediately.
|
||||
|
||||
Any characters encountered between the end of a previous image and
|
||||
the image separator character are to be ignored. This allows future GIF
|
||||
enhancements to be present in newer image formats and yet ignored safely
|
||||
by older software decoders.
|
||||
|
||||
bits
|
||||
7 6 5 4 3 2 1 0 Byte #
|
||||
+---------------+
|
||||
|0 0 1 0 1 1 0 0| 1 ',' - Image separator character
|
||||
+---------------+
|
||||
| | 2 Start of image in pixels from the
|
||||
+- Image Left -+ left side of the screen (LSB first)
|
||||
| | 3
|
||||
+---------------+
|
||||
| | 4
|
||||
+- Image Top -+ Start of image in pixels from the
|
||||
| | 5 top of the screen (LSB first)
|
||||
+---------------+
|
||||
| | 6
|
||||
+- Image Width -+ Width of the image in pixels (LSB first)
|
||||
| | 7
|
||||
+---------------+
|
||||
| | 8
|
||||
+- Image Height-+ Height of the image in pixels (LSB first)
|
||||
| | 9
|
||||
+-+-+-+-+-+-----+ M=0 - Use global color map, ignore 'pixel'
|
||||
|M|I|0|0|0|pixel| 10 M=1 - Local color map follows, use 'pixel'
|
||||
+-+-+-+-+-+-----+ I=0 - Image formatted in Sequential order
|
||||
I=1 - Image formatted in Interlaced order
|
||||
pixel+1 - # bits per pixel for this image
|
||||
|
||||
The specifications for the image position and size must be confined
|
||||
to the dimensions defined by the Screen Descriptor. On the other hand
|
||||
it is not necessary that the image fill the entire screen defined.
|
||||
|
||||
Graphics Interchange Format (GIF) Page 7
|
||||
|
||||
|
||||
Specification
|
||||
|
||||
LOCAL COLOR MAP
|
||||
|
||||
A Local Color Map is optional and defined here for future use. If
|
||||
the 'M' bit of byte 10 of the Image Descriptor is set, then a color map
|
||||
follows the Image Descriptor that applies only to the following image.
|
||||
At the end of the image, the color map will revert to that defined after
|
||||
the Screen Descriptor. Note that the 'pixel' field of byte 10 of the
|
||||
Image Descriptor is used only if a Local Color Map is indicated. This
|
||||
defines the parameters not only for the image pixel size, but determines
|
||||
the number of color map entries that follow. The bits per pixel value
|
||||
will also revert to the value specified in the Screen Descriptor when
|
||||
processing of the image is complete.
|
||||
|
||||
RASTER DATA
|
||||
|
||||
The format of the actual image is defined as the series of pixel
|
||||
color index values that make up the image. The pixels are stored left
|
||||
to right sequentially for an image row. By default each image row is
|
||||
written sequentially, top to bottom. In the case that the Interlace or
|
||||
'I' bit is set in byte 10 of the Image Descriptor then the row order of
|
||||
the image display follows a four-pass process in which the image is
|
||||
filled in by widely spaced rows. The first pass writes every 8th row,
|
||||
starting with the top row of the image window. The second pass writes
|
||||
every 8th row starting at the fifth row from the top. The third pass
|
||||
writes every 4th row starting at the third row from the top. The fourth
|
||||
pass completes the image, writing every other row, starting at the
|
||||
second row from the top. A graphic description of this process follows:
|
||||
|
||||
Image
|
||||
|
||||
Row Pass 1 Pass 2 Pass 3 Pass 4 Result
|
||||
---------------------------------------------------
|
||||
0 **1a** **1a**
|
||||
1 **4a** **4a**
|
||||
2 **3a** **3a**
|
||||
3 **4b** **4b**
|
||||
4 **2a** **2a**
|
||||
5 **4c** **4c**
|
||||
6 **3b** **3b**
|
||||
7 **4d** **4d**
|
||||
8 **1b** **1b**
|
||||
9 **4e** **4e**
|
||||
10 **3c** **3c**
|
||||
11 **4f** **4f**
|
||||
12 **2b** **2b**
|
||||
. . .
|
||||
|
||||
The image pixel values are processed as a series of color indices
|
||||
which map into the existing color map. The resulting color value from
|
||||
the map is what is actually displayed. This series of pixel indices,
|
||||
the number of which is equal to image-width*image-height pixels, are
|
||||
passed to the GIF image data stream one value per pixel, compressed and
|
||||
packaged according to a version of the LZW compression algorithm as
|
||||
defined in Appendix C.
|
||||
|
||||
Graphics Interchange Format (GIF) Page 8
|
||||
|
||||
|
||||
|
||||
Specification
|
||||
|
||||
GIF TERMINATOR
|
||||
|
||||
In order to provide a synchronization for the termination of a GIF
|
||||
image file, a GIF decoder will process the end of GIF mode when the
|
||||
character 0x3B hex or ';' is found after an image has been processed.
|
||||
By convention the decoding software will pause and wait for an action
|
||||
indicating that the user is ready to continue. This may be a carriage
|
||||
return entered at the keyboard or a mouse click. For interactive
|
||||
applications this user action must be passed on to the host as a
|
||||
carriage return character so that the host application can continue.
|
||||
The decoding software will then typically leave graphics mode and resume
|
||||
any previous process.
|
||||
|
||||
GIF EXTENSION BLOCKS
|
||||
|
||||
To provide for orderly extension of the GIF definition, a mechanism
|
||||
for defining the packaging of extensions within a GIF data stream is
|
||||
necessary. Specific GIF extensions are to be defined and documented by
|
||||
CompuServe in order to provide a controlled enhancement path.
|
||||
|
||||
GIF Extension Blocks are packaged in a manner similar to that used
|
||||
by the raster data though not compressed. The basic structure is:
|
||||
|
||||
7 6 5 4 3 2 1 0 Byte #
|
||||
+---------------+
|
||||
|0 0 1 0 0 0 0 1| 1 '!' - GIF Extension Block Introducer
|
||||
+---------------+
|
||||
| function code | 2 Extension function code (0 to 255)
|
||||
+---------------+ ---+
|
||||
| byte count | |
|
||||
+---------------+ |
|
||||
: : +-- Repeated as many times as necessary
|
||||
|func data bytes| |
|
||||
: : |
|
||||
+---------------+ ---+
|
||||
. . . . . .
|
||||
+---------------+
|
||||
|0 0 0 0 0 0 0 0| zero byte count (terminates block)
|
||||
+---------------+
|
||||
|
||||
A GIF Extension Block may immediately preceed any Image Descriptor
|
||||
or occur before the GIF Terminator.
|
||||
|
||||
All GIF decoders must be able to recognize the existence of GIF
|
||||
Extension Blocks and read past them if unable to process the function
|
||||
code. This ensures that older decoders will be able to process extended
|
||||
GIF image files in the future, though without the additional
|
||||
functionality.
|
||||
|
||||
Graphics Interchange Format (GIF) Page 9
|
||||
|
||||
Appendix A - Glossary
|
||||
|
||||
GLOSSARY
|
||||
|
||||
Pixel - The smallest picture element of a graphics image. This usually
|
||||
corresponds to a single dot on a graphics screen. Image resolution is
|
||||
typically given in units of pixels. For example a fairly standard
|
||||
graphics screen format is one 320 pixels across and 200 pixels high.
|
||||
Each pixel can appear as one of several colors depending on the
|
||||
capabilities of the graphics hardware.
|
||||
|
||||
Raster - A horizontal row of pixels representing one line of an image. A
|
||||
typical method of working with images since most hardware is oriented to
|
||||
work most efficiently in this manner.
|
||||
|
||||
LSB - Least Significant Byte. Refers to a convention for two byte numeric
|
||||
values in which the less significant byte of the value preceeds the more
|
||||
significant byte. This convention is typical on many microcomputers.
|
||||
|
||||
Color Map - The list of definitions of each color used in a GIF image.
|
||||
These desired colors are converted to available colors through a table
|
||||
which is derived by assigning an incoming color index (from the image)
|
||||
to an output color index (of the hardware). While the color map
|
||||
definitons are specified in a GIF image, the output pixel colors will
|
||||
vary based on the hardware used and its ability to match the defined
|
||||
color.
|
||||
|
||||
Interlace - The method of displaying a GIF image in which multiple passes
|
||||
are made, outputting raster lines spaced apart to provide a way of
|
||||
visualizing the general content of an entire image before all of the
|
||||
data has been processed.
|
||||
|
||||
B Protocol - A CompuServe-developed error-correcting file transfer protocol
|
||||
available in the public domain and implemented in CompuServe VIDTEX
|
||||
products. This error checking mechanism will be used in transfers of
|
||||
GIF images for interactive applications.
|
||||
|
||||
LZW - A sophisticated data compression algorithm based on work done by
|
||||
Lempel-Ziv & Welch which has the feature of very efficient one-pass
|
||||
encoding and decoding. This allows the image to be decompressed and
|
||||
displayed at the same time. The original article from which this
|
||||
technique was adapted is:
|
||||
|
||||
Terry A. Welch, "A Technique for High Performance Data
|
||||
Compression", IEEE Computer, vol 17 no 6 (June 1984)
|
||||
|
||||
This basic algorithm is also used in the public domain ARC file
|
||||
compression utilities. The CompuServe adaptation of LZW for GIF is
|
||||
described in Appendix C.
|
||||
|
||||
Graphics Interchange Format (GIF) Page 10
|
||||
|
||||
|
||||
|
||||
Appendix B - Interactive Sequences
|
||||
|
||||
GIF Sequence Exchanges for an Interactive Environment
|
||||
|
||||
The following sequences are defined for use in mediating control
|
||||
between a GIF sender and GIF receiver over an interactive communications
|
||||
line. These sequences do not apply to applications that involve
|
||||
downloading of static GIF files and are not considered part of a GIF
|
||||
file.
|
||||
|
||||
GIF CAPABILITIES ENQUIRY
|
||||
|
||||
The GCE sequence is issued from a host and requests an interactive
|
||||
GIF decoder to return a response message that defines the graphics
|
||||
parameters for the decoder. This involves returning information about
|
||||
available screen sizes, number of bits/color supported and the amount of
|
||||
color detail supported. The escape sequence for the GCE is defined as:
|
||||
|
||||
ESC [ > 0 g (g is lower case, spaces inserted for clarity)
|
||||
(0x1B 0x5B 0x3E 0x30 0x67)
|
||||
|
||||
GIF CAPABILITIES RESPONSE
|
||||
|
||||
The GIF Capabilities Response message is returned by an interactive
|
||||
GIF decoder and defines the decoder's display capabilities for all
|
||||
graphics modes that are supported by the software. Note that this can
|
||||
also include graphics printers as well as a monitor screen. The general
|
||||
format of this message is:
|
||||
|
||||
#version;protocol{;dev, width, height, color-bits, color-res}... <CR>
|
||||
|
||||
'#' - GCR identifier character (Number Sign)
|
||||
version - GIF format version number; initially '87a'
|
||||
protocol='0' - No end-to-end protocol supported by decoder
|
||||
Transfer as direct 8-bit data stream.
|
||||
protocol='1' - Can use an error correction protocol to transfer GIF data
|
||||
interactively from the host directly to the display.
|
||||
dev = '0' - Screen parameter set follows
|
||||
dev = '1' - Printer parameter set follows
|
||||
width - Maximum supported display width in pixels
|
||||
height - Maximum supported display height in pixels
|
||||
color-bits - Number of bits per pixel supported. The number of
|
||||
supported colors is therefore 2**color-bits.
|
||||
color-res - Number of bits per color component supported in the
|
||||
hardware color palette. If color-res is '0' then no
|
||||
hardware palette table is available.
|
||||
|
||||
Note that all values in the GCR are returned as ASCII decimal
|
||||
numbers and the message is terminated by a Carriage Return character.
|
||||
|
||||
Graphics Interchange Format (GIF) Page 11
|
||||
|
||||
|
||||
|
||||
Appendix B - Interactive Sequences
|
||||
|
||||
The following GCR message describes three standard EGA
|
||||
configurations with no printer; the GIF data stream can be processed
|
||||
within an error correcting protocol:
|
||||
|
||||
#87a;1 ;0,320,200,4,0 ;0,640,200,2,2 ;0,640,350,4,2<CR>
|
||||
|
||||
ENTER GIF GRAPHICS MODE
|
||||
|
||||
Two sequences are currently defined to invoke an interactive GIF
|
||||
decoder into action. The only difference between them is that different
|
||||
output media are selected. These sequences are:
|
||||
|
||||
ESC [ > 1 g Display GIF image on screen
|
||||
(0x1B 0x5B 0x3E 0x31 0x67)
|
||||
ESC [ > 2 g Display image directly to an attached graphics printer.
|
||||
The image may optionally be displayed on the screen as
|
||||
well.
|
||||
(0x1B 0x5B 0x3E 0x32 0x67)
|
||||
|
||||
Note that the 'g' character terminating each sequence is in lower
|
||||
case.
|
||||
|
||||
INTERACTIVE ENVIRONMENT
|
||||
|
||||
The assumed environment for the transmission of GIF image data from
|
||||
an interactive application is a full 8-bit data stream from host to
|
||||
micro. All 256 character codes must be transferrable. The establishing
|
||||
of an 8-bit data path for communications will normally be taken care of
|
||||
by the host application programs. It is however up to the receiving
|
||||
communications programs supporting GIF to be able to receive and pass on
|
||||
all 256 8-bit codes to the GIF decoder software.
|
||||
|
||||
Graphics Interchange Format (GIF) Page 12
|
||||
|
||||
|
||||
|
||||
Appendix C - Image Packaging & Compression
|
||||
|
||||
The Raster Data stream that represents the actual output image can
|
||||
be represented as:
|
||||
|
||||
7 6 5 4 3 2 1 0
|
||||
+---------------+
|
||||
| code size |
|
||||
+---------------+ ---+
|
||||
|blok byte count| |
|
||||
+---------------+ |
|
||||
: : +-- Repeated as many times as necessary
|
||||
| data bytes | |
|
||||
: : |
|
||||
+---------------+ ---+
|
||||
. . . . . .
|
||||
+---------------+
|
||||
|0 0 0 0 0 0 0 0| zero byte count (terminates data stream)
|
||||
+---------------+
|
||||
|
||||
The conversion of the image from a series of pixel values to a
|
||||
transmitted or stored character stream involves several steps. In brief
|
||||
these steps are:
|
||||
|
||||
1. Establish the Code Size - Define the number of bits needed to
|
||||
represent the actual data.
|
||||
2. Compress the Data - Compress the series of image pixels to a series
|
||||
of compression codes.
|
||||
3. Build a Series of Bytes - Take the set of compression codes and
|
||||
convert to a string of 8-bit bytes.
|
||||
4. Package the Bytes - Package sets of bytes into blocks preceeded by
|
||||
character counts and output.
|
||||
|
||||
ESTABLISH CODE SIZE
|
||||
|
||||
The first byte of the GIF Raster Data stream is a value indicating
|
||||
the minimum number of bits required to represent the set of actual pixel
|
||||
values. Normally this will be the same as the number of color bits.
|
||||
Because of some algorithmic constraints however, black & white images
|
||||
which have one color bit must be indicated as having a code size of 2.
|
||||
This code size value also implies that the compression codes must start
|
||||
out one bit longer.
|
||||
|
||||
COMPRESSION
|
||||
|
||||
The LZW algorithm converts a series of data values into a series of
|
||||
codes which may be raw values or a code designating a series of values.
|
||||
Using text characters as an analogy, the output code consists of a
|
||||
character or a code representing a string of characters.
|
||||
|
||||
Graphics Interchange Format (GIF) Page 13
|
||||
|
||||
Appendix C - Image Packaging & Compression
|
||||
|
||||
The LZW algorithm used in GIF matches algorithmically with the
|
||||
standard LZW algorithm with the following differences:
|
||||
|
||||
1. A special Clear code is defined which resets all
|
||||
compression/decompression parameters and tables to a start-up state.
|
||||
The value of this code is 2**<code size>. For example if the code
|
||||
size indicated was 4 (image was 4 bits/pixel) the Clear code value
|
||||
would be 16 (10000 binary). The Clear code can appear at any point
|
||||
in the image data stream and therefore requires the LZW algorithm to
|
||||
process succeeding codes as if a new data stream was starting.
|
||||
Encoders should output a Clear code as the first code of each image
|
||||
data stream.
|
||||
|
||||
2. An End of Information code is defined that explicitly indicates the
|
||||
end of the image data stream. LZW processing terminates when this
|
||||
code is encountered. It must be the last code output by the encoder
|
||||
for an image. The value of this code is <Clear code>+1.
|
||||
|
||||
3. The first available compression code value is <Clear code>+2.
|
||||
|
||||
4. The output codes are of variable length, starting at <code size>+1
|
||||
bits per code, up to 12 bits per code. This defines a maximum code
|
||||
value of 4095 (hex FFF). Whenever the LZW code value would exceed
|
||||
the current code length, the code length is increased by one. The
|
||||
packing/unpacking of these codes must then be altered to reflect the
|
||||
new code length.
|
||||
|
||||
BUILD 8-BIT BYTES
|
||||
|
||||
Because the LZW compression used for GIF creates a series of
|
||||
variable length codes, of between 3 and 12 bits each, these codes must
|
||||
be reformed into a series of 8-bit bytes that will be the characters
|
||||
actually stored or transmitted. This provides additional compression of
|
||||
the image. The codes are formed into a stream of bits as if they were
|
||||
packed right to left and then picked off 8 bits at a time to be output.
|
||||
Assuming a character array of 8 bits per character and using 5 bit codes
|
||||
to be packed, an example layout would be similar to:
|
||||
|
||||
byte n byte 5 byte 4 byte 3 byte 2 byte 1
|
||||
+-.....-----+--------+--------+--------+--------+--------+
|
||||
| and so on |hhhhhggg|ggfffffe|eeeedddd|dcccccbb|bbbaaaaa|
|
||||
+-.....-----+--------+--------+--------+--------+--------+
|
||||
|
||||
Note that the physical packing arrangement will change as the
|
||||
number of bits per compression code change but the concept remains the
|
||||
same.
|
||||
|
||||
PACKAGE THE BYTES
|
||||
|
||||
Once the bytes have been created, they are grouped into blocks for
|
||||
output by preceeding each block of 0 to 255 bytes with a character count
|
||||
byte. A block with a zero byte count terminates the Raster Data stream
|
||||
for a given image. These blocks are what are actually output for the
|
||||
|
||||
Graphics Interchange Format (GIF) Page 14
|
||||
|
||||
|
||||
|
||||
Appendix C - Image Packaging & Compression
|
||||
|
||||
GIF image. This block format has the side effect of allowing a decoding
|
||||
program the ability to read past the actual image data if necessary by
|
||||
reading block counts and then skipping over the data.
|
||||
|
||||
Graphics Interchange Format (GIF) Page 15
|
||||
|
||||
|
||||
|
||||
|
||||
Appendix D - Multiple Image Processing
|
||||
|
||||
Since a GIF data stream can contain multiple images, it is
|
||||
necessary to describe processing and display of such a file. Because
|
||||
the image descriptor allows for placement of the image within the
|
||||
logical screen, it is possible to define a sequence of images that may
|
||||
each be a partial screen, but in total fill the entire screen. The
|
||||
guidelines for handling the multiple image situation are:
|
||||
|
||||
1. There is no pause between images. Each is processed immediately as
|
||||
seen by the decoder.
|
||||
|
||||
2. Each image explicitly overwrites any image already on the screen
|
||||
inside of its window. The only screen clears are at the beginning
|
||||
and end of the GIF image process. See discussion on the GIF
|
||||
terminator.
|
||||
@@ -0,0 +1,62 @@
|
||||
ul {
|
||||
list-style-type:disc;
|
||||
}
|
||||
ul ul {
|
||||
list-style-type:circle;
|
||||
}
|
||||
|
||||
div#notes {
|
||||
font-style:italic;
|
||||
}
|
||||
|
||||
table.invisible {
|
||||
border-spacing:0;
|
||||
}
|
||||
|
||||
table#interlace td {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
div.hiddenparagraph {
|
||||
display:none;
|
||||
}
|
||||
|
||||
@media not print {
|
||||
a[href*="#"] {
|
||||
text-decoration:none;
|
||||
color:blue;
|
||||
}
|
||||
|
||||
span.rcomp {
|
||||
background:#FAA;
|
||||
}
|
||||
span.gcomp {
|
||||
background:#8F8;
|
||||
}
|
||||
span.bcomp {
|
||||
background:#BBF;
|
||||
}
|
||||
|
||||
h2 span {
|
||||
font-size:small;
|
||||
font-weight:normal;
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
div.togglevisall span {
|
||||
font-weight:bold;
|
||||
text-decoration:underline;
|
||||
}
|
||||
}
|
||||
|
||||
@media print {
|
||||
table,
|
||||
li {
|
||||
page-break-inside:avoid;
|
||||
}
|
||||
|
||||
h2 span,
|
||||
div.togglevisall {
|
||||
display:none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
function ToggleVis(number) {
|
||||
// toggle visibility of a single chapter
|
||||
id = "p" + number;
|
||||
c = document.getElementById(id).className;
|
||||
c = (c == "" ? "hiddenparagraph" : "");
|
||||
document.getElementById(id).className = c;
|
||||
}
|
||||
|
||||
function SetEveryVis(status) {
|
||||
// set visibility of every chapter
|
||||
c = (status == 0 ? "hiddenparagraph" : "");
|
||||
for(i = 0; i <= 35; i++) {
|
||||
document.getElementById("p" + i).className = c;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/* some pages also use their own CSS files, so: NO CUSTOM CLASS NAMES HERE */
|
||||
|
||||
body {
|
||||
background:white;
|
||||
color:black;
|
||||
font-family:sans-serif;
|
||||
}
|
||||
|
||||
table {
|
||||
background:black;
|
||||
border-spacing:2px;
|
||||
}
|
||||
th, td {
|
||||
padding:3px 5px;
|
||||
vertical-align:middle;
|
||||
empty-cells:show;
|
||||
}
|
||||
th {
|
||||
background:silver;
|
||||
}
|
||||
td {
|
||||
background:white;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align:center;
|
||||
}
|
||||
pre, tt {
|
||||
font-size:120%;
|
||||
}
|
||||
abbr {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.noprint {
|
||||
display:none;
|
||||
}
|
||||
a[href] {
|
||||
color:black;
|
||||
text-decoration:none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
'\" t
|
||||
.\" Title: giftext
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 2 May 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIFTEXT" "1" "2 May 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
giftext \- dump GIF pixels and metadata as text
|
||||
.SH "SYNOPSIS"
|
||||
.HP \w'\fBgiftext\fR\ 'u
|
||||
\fBgiftext\fR [\-v] [\-c] [\-e] [\-z] [\-p] [\-r] [\-h] [\fIgif\-file\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
A program to dump (text only) general information about GIF file\&.
|
||||
.PP
|
||||
If no GIF file is given, giftext will try to read a GIF file from stdin\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\-v
|
||||
.RS 4
|
||||
Verbose mode (show progress)\&. Enables printout of running scan lines\&.
|
||||
.RE
|
||||
.PP
|
||||
\-c
|
||||
.RS 4
|
||||
Dumps the color maps\&.
|
||||
.RE
|
||||
.PP
|
||||
\-e
|
||||
.RS 4
|
||||
Dumps encoded bytes \- the pixels after compressed using LZ algorithm and chained to form bytes\&. This is the form the data is saved in the GIF file\&. Dumps in hex \- 2 digit per byte\&.
|
||||
.RE
|
||||
.PP
|
||||
\-z
|
||||
.RS 4
|
||||
Dumps the LZ codes of the image\&. Dumps in hex \- 3 digits per code (as we are limited to 12 bits)\&.
|
||||
.RE
|
||||
.PP
|
||||
\-p
|
||||
.RS 4
|
||||
Dumps the pixels of the image\&. Dumps in hex \- 2 digit per pixel (<=byte)\&.
|
||||
.RE
|
||||
.PP
|
||||
\-r
|
||||
.RS 4
|
||||
Dumps raw pixels as one byte per pixel\&. This option inhibits all other options and only the pixels are dumped\&. This option may be used to convert GIF files into raw data\&. Note: the color map can be extracted by gifclrmp utility\&. If more than one image is included in the file, all images will be dumped in order\&.
|
||||
.RE
|
||||
.PP
|
||||
\-h
|
||||
.RS 4
|
||||
Print one line of command line help, similar to Usage above\&.
|
||||
.RE
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
Gershon Elber\&.
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>giftext</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="giftext.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>giftext — dump GIF pixels and metadata as text</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">giftext</code> [-v] [-c] [-e] [-z] [-p] [-r] [-h] [<em class="replaceable"><code>gif-file</code></em>]</p></div></div><div class="refsect1"><a id="idm24"></a><h2>Description</h2><p>A program to dump (text only) general information about GIF file.</p><p>If no GIF file is given, giftext will try to read a GIF file
|
||||
from stdin.</p></div><div class="refsect1"><a id="idm28"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><p> Verbose mode (show progress).
|
||||
Enables printout of running scan lines. </p></dd><dt><span class="term">-c</span></dt><dd><p> Dumps the color maps.</p></dd><dt><span class="term">-e</span></dt><dd><p> Dumps encoded bytes - the pixels after compressed using LZ
|
||||
algorithm and chained to form bytes. This is the form the data is
|
||||
saved in the GIF file. Dumps in hex - 2 digit per byte.</p></dd><dt><span class="term">-z</span></dt><dd><p> Dumps the LZ codes of the image. Dumps in hex - 3 digits per
|
||||
code (as we are limited to 12 bits).</p></dd><dt><span class="term">-p</span></dt><dd><p> Dumps the pixels of the image. Dumps in hex - 2 digit per
|
||||
pixel (<=byte).</p></dd><dt><span class="term">-r</span></dt><dd><p> Dumps raw pixels as one byte per pixel. This option inhibits
|
||||
all other options and only the pixels are dumped. This option may be
|
||||
used to convert GIF files into raw data. Note: the color map can be
|
||||
extracted by gifclrmp utility. If more than one image is included in
|
||||
the file, all images will be dumped in order.</p></dd><dt><span class="term">-h</span></dt><dd><p> Print one line of command line help, similar to Usage
|
||||
above.</p></dd></dl></div></div><div class="refsect1"><a id="idm59"></a><h2>Author</h2><p>Gershon Elber.</p></div></div></body></html>
|
||||
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||
<refentry id='giftext.1'>
|
||||
<refentryinfo><date>2 May 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>giftext</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>giftext</refname>
|
||||
<refpurpose>dump GIF pixels and metadata as text</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>giftext</command>
|
||||
<arg choice='opt'>-v</arg>
|
||||
<arg choice='opt'>-c</arg>
|
||||
<arg choice='opt'>-e</arg>
|
||||
<arg choice='opt'>-z</arg>
|
||||
<arg choice='opt'>-p</arg>
|
||||
<arg choice='opt'>-r</arg>
|
||||
<arg choice='opt'>-h</arg>
|
||||
<arg choice='opt'><replaceable>gif-file</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
|
||||
<para>A program to dump (text only) general information about GIF file.</para>
|
||||
|
||||
<para>If no GIF file is given, giftext will try to read a GIF file
|
||||
from stdin.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Options</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para> Verbose mode (show progress).
|
||||
Enables printout of running scan lines. </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-c</term>
|
||||
<listitem>
|
||||
<para> Dumps the color maps.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-e</term>
|
||||
<listitem>
|
||||
<para> Dumps encoded bytes - the pixels after compressed using LZ
|
||||
algorithm and chained to form bytes. This is the form the data is
|
||||
saved in the GIF file. Dumps in hex - 2 digit per byte.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-z</term>
|
||||
<listitem>
|
||||
<para> Dumps the LZ codes of the image. Dumps in hex - 3 digits per
|
||||
code (as we are limited to 12 bits).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-p</term>
|
||||
<listitem>
|
||||
<para> Dumps the pixels of the image. Dumps in hex - 2 digit per
|
||||
pixel (<=byte).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-r</term>
|
||||
<listitem>
|
||||
<para> Dumps raw pixels as one byte per pixel. This option inhibits
|
||||
all other options and only the pixels are dumped. This option may be
|
||||
used to convert GIF files into raw data. Note: the color map can be
|
||||
extracted by gifclrmp utility. If more than one image is included in
|
||||
the file, all images will be dumped in order.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-h</term>
|
||||
<listitem>
|
||||
<para> Print one line of command line help, similar to Usage
|
||||
above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Author</title>
|
||||
|
||||
<para>Gershon Elber.</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
@@ -0,0 +1,157 @@
|
||||
'\" t
|
||||
.\" Title: giftool
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 3 June 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIFTOOL" "1" "3 June 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
giftool \- GIF transformation tool
|
||||
.SH "SYNOPSIS"
|
||||
.HP \w'\fBgiftool\fR\ 'u
|
||||
\fBgiftool\fR [\-a\ \fIaspect\fR] [\-b\ \fIbgcolor\fR] [\-d\ \fIdelaytime\fR] [\-i\ \fIinterlacing\fR] [\-n\ \fIimagelist\fR] [\-p\ \fIleft,top\fR] [\-s\ \fIwidth,height\fR] [\-t\ \fItranscolor\fR] [\-u\ \fIsort\-flag\fR] [\-x\ \fIdisposal\fR] [\-z\ \fIsort\-flag\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
A filter for transforming GIFS\&. With no options, it\*(Aqs an expensive copy of a GIF in standard input to standard output\&. Options specify filtering operations and are performed in the order specified on the command line\&.
|
||||
.PP
|
||||
The \-n option selects images, allowing the tool to act on a subset of images in a multi\-image GIF\&. This option takes a comma\-separated list of decimal integers which are interpreted as 1\-origin image indices; these are the images that will be acted on\&. If no \-n option is specified, the tool will select and transform all images\&.
|
||||
.PP
|
||||
The \-b option takes a decimal integer argument and uses it to set the (0\-origin) screen background color index\&.
|
||||
.PP
|
||||
The \-f option accepts a printf\-style format string and substitutes into it the values of image\-descriptor and graphics\-control fields\&. The string is formatted and output once for each selected image\&. Normal C\-style escapes \eb, \ef, \en, \er, \et\&. \ev, and \exNN are interpreted; also \ee produces ESC (ASCII 0x1b)\&. The following format cookies are substituted:
|
||||
.PP
|
||||
%a
|
||||
.RS 4
|
||||
Pixel aspect byte\&.
|
||||
.RE
|
||||
.PP
|
||||
%b
|
||||
.RS 4
|
||||
Screen background color\&.
|
||||
.RE
|
||||
.PP
|
||||
%d
|
||||
.RS 4
|
||||
Image delay time
|
||||
.RE
|
||||
.PP
|
||||
%h
|
||||
.RS 4
|
||||
Image height (y dimension)
|
||||
.RE
|
||||
.PP
|
||||
%n
|
||||
.RS 4
|
||||
Image index
|
||||
.RE
|
||||
.PP
|
||||
%p
|
||||
.RS 4
|
||||
Image position (as an x,y pair)
|
||||
.RE
|
||||
.PP
|
||||
%s
|
||||
.RS 4
|
||||
Screen size (as an x,y pair)
|
||||
.RE
|
||||
.PP
|
||||
%t
|
||||
.RS 4
|
||||
Image transparent\-color index
|
||||
.RE
|
||||
.PP
|
||||
%u
|
||||
.RS 4
|
||||
Image user\-input flag (boolean)
|
||||
.RE
|
||||
.PP
|
||||
%v
|
||||
.RS 4
|
||||
GIF version string
|
||||
.RE
|
||||
.PP
|
||||
%w
|
||||
.RS 4
|
||||
Image width (x dimension)
|
||||
.RE
|
||||
.PP
|
||||
%x
|
||||
.RS 4
|
||||
Image GIF89 disposal mode
|
||||
.RE
|
||||
.PP
|
||||
%z
|
||||
.RS 4
|
||||
Image\*(Aqs color table sort flag (boolean, false if no local color map)
|
||||
.RE
|
||||
.PP
|
||||
Boolean substitutions may take a prefix to modify how they are displayed:
|
||||
.PP
|
||||
1
|
||||
.RS 4
|
||||
"1" or "0"
|
||||
.RE
|
||||
.PP
|
||||
o
|
||||
.RS 4
|
||||
"on" or "off"
|
||||
.RE
|
||||
.PP
|
||||
t
|
||||
.RS 4
|
||||
"t" or "f"
|
||||
.RE
|
||||
.PP
|
||||
y
|
||||
.RS 4
|
||||
"yes" or "no"
|
||||
.RE
|
||||
.PP
|
||||
Thus, for example, "%oz" displays image sort flags using the strings "on" and "off"\&. The default with no prefix is numeric\&.
|
||||
.PP
|
||||
The \-a option takes an unsigned decimal integer argument and uses it to set the aspect\-ratio bye in the logical screen descriptor block\&.
|
||||
.PP
|
||||
The \-b option takes an unsigned decimal integer argument and uses it to set the background color index in the logical screen descriptor block\&.
|
||||
.PP
|
||||
The \-d option takes a decimal integer argument and uses it to set a delay time, in hundredths of a second, on selected images\&.
|
||||
.PP
|
||||
The \-i option sets or clears interlaccing in selected images\&. Acceptable arguments are "1", "0", "yes", "no", "on", "off", "t", "f"
|
||||
.PP
|
||||
The \-p option takes a (0\-origin) x,y coordinate\-pair and sets it as the preferred upper\-left\-corner coordinates of selected images\&.
|
||||
.PP
|
||||
The \-s option takes a (0\-origin) x,y coordinate\-pair and sets it as the expected display screen size\&.
|
||||
.PP
|
||||
The \-t option takes a decimal integer argument and uses it to set the (0\-origin) index of the transparency color in selected images\&.
|
||||
.PP
|
||||
The \-u option sets or clears the user\-input flag in selected images\&. Acceptable arguments are "1", "0", "yes", "no", "on", "off", "t", "f"\&.
|
||||
.PP
|
||||
The \-x option takes a decimal integer argument and uses it to set the GIF89 disposal mode in selected images\&.
|
||||
.PP
|
||||
The \-z option sets or clears the color\-table sort flag in selected images\&. Acceptable arguments are "1", "0", "yes", "no", "on", "off", "t", "f"\&.
|
||||
.PP
|
||||
Note that the \-a, \-b, \-p, \-s, and \-z options are included to complete the ability to modify all fields defined in the GIF standard, but should have no effect on how an image renders on browsers or modern viewers\&.
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
Eric S\&. Raymond\&.
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>giftool</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="giftool.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>giftool — GIF transformation tool</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">giftool</code> [-a <em class="replaceable"><code>aspect</code></em>] [-b <em class="replaceable"><code>bgcolor</code></em>] [-d <em class="replaceable"><code>delaytime</code></em>] [-i <em class="replaceable"><code>interlacing</code></em>] [-n <em class="replaceable"><code>imagelist</code></em>] [-p <em class="replaceable"><code>left,top</code></em>] [-s <em class="replaceable"><code>width,height</code></em>] [-t <em class="replaceable"><code>transcolor</code></em>] [-u <em class="replaceable"><code>sort-flag</code></em>] [-x <em class="replaceable"><code>disposal</code></em>] [-z <em class="replaceable"><code>sort-flag</code></em>]</p></div></div><div class="refsect1"><a id="idm37"></a><h2>Description</h2><p>A filter for transforming GIFS. With no options, it's an expensive
|
||||
copy of a GIF in standard input to standard output. Options specify
|
||||
filtering operations and are performed in the order specified on the command
|
||||
line.</p><p>The -n option selects images, allowing the tool to act on a
|
||||
subset of images in a multi-image GIF. This option takes a
|
||||
comma-separated list of decimal integers which are interpreted as
|
||||
1-origin image indices; these are the images that will be acted on.
|
||||
If no -n option is specified, the tool will select and transform all
|
||||
images.</p><p>The -b option takes a decimal integer argument and uses it to
|
||||
set the (0-origin) screen background color index.</p><p>The -f option accepts a printf-style format string and
|
||||
substitutes into it the values of image-descriptor and graphics-control
|
||||
fields. The string is formatted and output once for each selected
|
||||
image. Normal C-style escapes \b, \f, \n, \r, \t. \v, and \xNN are
|
||||
interpreted; also \e produces ESC (ASCII 0x1b). The following format
|
||||
cookies are substituted:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">%a</span></dt><dd><p>Pixel aspect byte.</p></dd><dt><span class="term">%b</span></dt><dd><p>Screen background color.</p></dd><dt><span class="term">%d</span></dt><dd><p>Image delay time</p></dd><dt><span class="term">%h</span></dt><dd><p>Image height (y dimension)</p></dd><dt><span class="term">%n</span></dt><dd><p>Image index</p></dd><dt><span class="term">%p</span></dt><dd><p>Image position (as an x,y pair)</p></dd><dt><span class="term">%s</span></dt><dd><p>Screen size (as an x,y pair)</p></dd><dt><span class="term">%t</span></dt><dd><p>Image transparent-color index</p></dd><dt><span class="term">%u</span></dt><dd><p>Image user-input flag (boolean)</p></dd><dt><span class="term">%v</span></dt><dd><p>GIF version string</p></dd><dt><span class="term">%w</span></dt><dd><p>Image width (x dimension)</p></dd><dt><span class="term">%x</span></dt><dd><p>Image GIF89 disposal mode</p></dd><dt><span class="term">%z</span></dt><dd><p>Image's color table sort flag (boolean,
|
||||
false if no local color map)</p></dd></dl></div><p>Boolean substitutions may take a prefix to modify how they are
|
||||
displayed:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">1</span></dt><dd><p>"1" or "0"</p></dd><dt><span class="term">o</span></dt><dd><p>"on" or "off"</p></dd><dt><span class="term">t</span></dt><dd><p>"t" or "f"</p></dd><dt><span class="term">y</span></dt><dd><p>"yes" or "no"</p></dd></dl></div><p>Thus, for example, "%oz" displays image sort flags using the
|
||||
strings "on" and "off". The default with no prefix is numeric.</p><p>The -a option takes an unsigned decimal integer argument and
|
||||
uses it to set the aspect-ratio bye in the logical screen descriptor
|
||||
block.</p><p>The -b option takes an unsigned decimal integer argument and
|
||||
uses it to set the background color index in the logical screen
|
||||
descriptor block.</p><p>The -d option takes a decimal integer argument and uses it to set a delay
|
||||
time, in hundredths of a second, on selected images.</p><p>The -i option sets or clears interlaccing in selected images. Acceptable arguments are "1", "0", "yes", "no", "on", "off", "t", "f"</p><p>The -p option takes a (0-origin) x,y coordinate-pair and sets it
|
||||
as the preferred upper-left-corner coordinates of selected
|
||||
images.</p><p>The -s option takes a (0-origin) x,y coordinate-pair and sets it
|
||||
as the expected display screen size.</p><p>The -t option takes a decimal integer argument and uses it to set the
|
||||
(0-origin) index of the transparency color in selected images.</p><p>The -u option sets or clears the user-input flag in selected
|
||||
images. Acceptable arguments are "1", "0", "yes", "no", "on", "off",
|
||||
"t", "f".</p><p>The -x option takes a decimal integer argument and uses it to set the
|
||||
GIF89 disposal mode in selected images.</p><p>The -z option sets or clears the color-table sort flag in
|
||||
selected images. Acceptable arguments are "1", "0", "yes", "no",
|
||||
"on", "off", "t", "f".</p><p>Note that the -a, -b, -p, -s, and -z options are included to
|
||||
complete the ability to modify all fields defined in the GIF standard,
|
||||
but should have no effect on how an image renders on browsers or
|
||||
modern viewers.</p></div><div class="refsect1"><a id="idm126"></a><h2>Author</h2><p>Eric S. Raymond.</p></div></div></body></html>
|
||||
@@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||
<refentry id='giftool.1'>
|
||||
<refentryinfo><date>3 June 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>giftool</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>giftool</refname>
|
||||
<refpurpose>GIF transformation tool</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>giftool</command>
|
||||
<arg choice='opt'>-a <replaceable>aspect</replaceable></arg>
|
||||
<arg choice='opt'>-b <replaceable>bgcolor</replaceable></arg>
|
||||
<arg choice='opt'>-d <replaceable>delaytime</replaceable></arg>
|
||||
<arg choice='opt'>-i <replaceable>interlacing</replaceable></arg>
|
||||
<arg choice='opt'>-n <replaceable>imagelist</replaceable></arg>
|
||||
<arg choice='opt'>-p <replaceable>left,top</replaceable></arg>
|
||||
<arg choice='opt'>-s <replaceable>width,height</replaceable></arg>
|
||||
<arg choice='opt'>-t <replaceable>transcolor</replaceable></arg>
|
||||
<arg choice='opt'>-u <replaceable>sort-flag</replaceable></arg>
|
||||
<arg choice='opt'>-x <replaceable>disposal</replaceable></arg>
|
||||
<arg choice='opt'>-z <replaceable>sort-flag</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
|
||||
<para>A filter for transforming GIFS. With no options, it's an expensive
|
||||
copy of a GIF in standard input to standard output. Options specify
|
||||
filtering operations and are performed in the order specified on the command
|
||||
line.</para>
|
||||
|
||||
<para>The -n option selects images, allowing the tool to act on a
|
||||
subset of images in a multi-image GIF. This option takes a
|
||||
comma-separated list of decimal integers which are interpreted as
|
||||
1-origin image indices; these are the images that will be acted on.
|
||||
If no -n option is specified, the tool will select and transform all
|
||||
images.</para>
|
||||
|
||||
<para>The -b option takes a decimal integer argument and uses it to
|
||||
set the (0-origin) screen background color index.</para>
|
||||
|
||||
<para>The -f option accepts a printf-style format string and
|
||||
substitutes into it the values of image-descriptor and graphics-control
|
||||
fields. The string is formatted and output once for each selected
|
||||
image. Normal C-style escapes \b, \f, \n, \r, \t. \v, and \xNN are
|
||||
interpreted; also \e produces ESC (ASCII 0x1b). The following format
|
||||
cookies are substituted:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>%a</term>
|
||||
<listitem><para>Pixel aspect byte.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>%b</term>
|
||||
<listitem><para>Screen background color.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>%d</term>
|
||||
<listitem><para>Image delay time</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>%h</term>
|
||||
<listitem><para>Image height (y dimension)</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>%n</term>
|
||||
<listitem><para>Image index</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>%p</term>
|
||||
<listitem><para>Image position (as an x,y pair)</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>%s</term>
|
||||
<listitem><para>Screen size (as an x,y pair)</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>%t</term>
|
||||
<listitem><para>Image transparent-color index</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>%u</term>
|
||||
<listitem><para>Image user-input flag (boolean)</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>%v</term>
|
||||
<listitem><para>GIF version string</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>%w</term>
|
||||
<listitem><para>Image width (x dimension)</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>%x</term>
|
||||
<listitem><para>Image GIF89 disposal mode</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>%z</term>
|
||||
<listitem><para>Image's color table sort flag (boolean,
|
||||
false if no local color map)</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>Boolean substitutions may take a prefix to modify how they are
|
||||
displayed:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>1</term>
|
||||
<listitem><para>"1" or "0"</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>o</term>
|
||||
<listitem><para>"on" or "off"</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>t</term>
|
||||
<listitem><para>"t" or "f"</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>y</term>
|
||||
<listitem><para>"yes" or "no"</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>Thus, for example, "%oz" displays image sort flags using the
|
||||
strings "on" and "off". The default with no prefix is numeric.</para>
|
||||
|
||||
<para>The -a option takes an unsigned decimal integer argument and
|
||||
uses it to set the aspect-ratio bye in the logical screen descriptor
|
||||
block.</para>
|
||||
|
||||
<para>The -b option takes an unsigned decimal integer argument and
|
||||
uses it to set the background color index in the logical screen
|
||||
descriptor block.</para>
|
||||
|
||||
<para>The -d option takes a decimal integer argument and uses it to set a delay
|
||||
time, in hundredths of a second, on selected images.</para>
|
||||
|
||||
<para>The -i option sets or clears interlaccing in selected images. Acceptable arguments are "1", "0", "yes", "no", "on", "off", "t", "f"</para>
|
||||
|
||||
<para>The -p option takes a (0-origin) x,y coordinate-pair and sets it
|
||||
as the preferred upper-left-corner coordinates of selected
|
||||
images.</para>
|
||||
|
||||
<para>The -s option takes a (0-origin) x,y coordinate-pair and sets it
|
||||
as the expected display screen size.</para>
|
||||
|
||||
<para>The -t option takes a decimal integer argument and uses it to set the
|
||||
(0-origin) index of the transparency color in selected images.</para>
|
||||
|
||||
<para>The -u option sets or clears the user-input flag in selected
|
||||
images. Acceptable arguments are "1", "0", "yes", "no", "on", "off",
|
||||
"t", "f".</para>
|
||||
|
||||
<para>The -x option takes a decimal integer argument and uses it to set the
|
||||
GIF89 disposal mode in selected images.</para>
|
||||
|
||||
<para>The -z option sets or clears the color-table sort flag in
|
||||
selected images. Acceptable arguments are "1", "0", "yes", "no",
|
||||
"on", "off", "t", "f".</para>
|
||||
|
||||
<para>Note that the -a, -b, -p, -s, and -z options are included to
|
||||
complete the ability to modify all fields defined in the GIF standard,
|
||||
but should have no effect on how an image renders on browsers or
|
||||
modern viewers.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Author</title>
|
||||
|
||||
<para>Eric S. Raymond.</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
'\" t
|
||||
.\" Title: gifwedge
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
||||
.\" Date: 2 May 2012
|
||||
.\" Manual: GIFLIB Documentation
|
||||
.\" Source: GIFLIB
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "GIFWEDGE" "1" "2 May 2012" "GIFLIB" "GIFLIB Documentation"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
gifwedge \- create a GIF test pattern
|
||||
.SH "SYNOPSIS"
|
||||
.HP \w'\fBgifwedge\fR\ 'u
|
||||
\fBgifwedge\fR [\-v] [\-l\ \fIlvls\fR] [\-s\ \fIsizex\fR\ \fIsizey\fR] [\-h] [\fIgif\-file\fR]
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
A program to create a test GIF image with intensity levels of the RGB colors YCM colors and white\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\-v
|
||||
.RS 4
|
||||
Verbose mode (show progress)\&. Enables printout of running scan lines\&.
|
||||
.RE
|
||||
.PP
|
||||
\-l lvls
|
||||
.RS 4
|
||||
Set number of intensity levels per color\&. This number must be power of two up to 32, as Gif format can only have 256 color simultaneously and 7 basic colors are to be displayed\&.
|
||||
.RE
|
||||
.PP
|
||||
\-s sizex sizey
|
||||
.RS 4
|
||||
Force image size to be SizeX by SizeY pixels\&. Image size will be rounded down to be a multiple of number of intensities horizontally, and 7 (colors) vertically\&.
|
||||
.RE
|
||||
.PP
|
||||
\-h
|
||||
.RS 4
|
||||
Print one line command line help, similar to Usage above\&.
|
||||
.RE
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
Gershon Elber\&.
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>gifwedge</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="gifwedge.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>gifwedge — create a GIF test pattern</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">gifwedge</code> [-v] [-l <em class="replaceable"><code>lvls</code></em>] [-s
|
||||
<em class="replaceable"><code>sizex</code></em>
|
||||
<em class="replaceable"><code>sizey</code></em>] [-h] [<em class="replaceable"><code>gif-file</code></em>]</p></div></div><div class="refsect1"><a id="idm24"></a><h2>Description</h2><p>A program to create a test GIF image with intensity levels of
|
||||
the RGB colors YCM colors and white.</p></div><div class="refsect1"><a id="idm27"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><p>Verbose mode (show progress).
|
||||
Enables printout of running scan lines. </p></dd><dt><span class="term">-l lvls</span></dt><dd><p>Set number of intensity levels per color. This number must be
|
||||
power of two up to 32, as Gif format can only have 256 color
|
||||
simultaneously and 7 basic colors are to be displayed.</p></dd><dt><span class="term">-s sizex sizey</span></dt><dd><p>Force image size to be SizeX by SizeY pixels. Image size will be
|
||||
rounded down to be a multiple of number of intensities horizontally,
|
||||
and 7 (colors) vertically.</p></dd><dt><span class="term">-h</span></dt><dd><p>Print one line command line help, similar to Usage above.</p></dd></dl></div></div><div class="refsect1"><a id="idm46"></a><h2>Author</h2><p>Gershon Elber.</p></div></div></body></html>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||
<refentry id='gifwedge.1'>
|
||||
<refentryinfo><date>2 May 2012</date></refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>gifwedge</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="source">GIFLIB</refmiscinfo>
|
||||
<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>gifwedge</refname>
|
||||
<refpurpose>create a GIF test pattern</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>gifwedge</command>
|
||||
<arg choice='opt'>-v</arg>
|
||||
<arg choice='opt'>-l <replaceable>lvls</replaceable></arg>
|
||||
<arg choice='opt'>-s
|
||||
<replaceable>sizex</replaceable>
|
||||
<replaceable>sizey</replaceable></arg>
|
||||
<arg choice='opt'>-h</arg>
|
||||
<arg choice='opt'><replaceable>gif-file</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
|
||||
<para>A program to create a test GIF image with intensity levels of
|
||||
the RGB colors YCM colors and white.</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Options</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para>Verbose mode (show progress).
|
||||
Enables printout of running scan lines. </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-l lvls</term>
|
||||
<listitem>
|
||||
<para>Set number of intensity levels per color. This number must be
|
||||
power of two up to 32, as Gif format can only have 256 color
|
||||
simultaneously and 7 basic colors are to be displayed.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-s sizex sizey</term>
|
||||
<listitem>
|
||||
<para>Force image size to be SizeX by SizeY pixels. Image size will be
|
||||
rounded down to be a multiple of number of intensities horizontally,
|
||||
and 7 (colors) vertically.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-h</term>
|
||||
<listitem>
|
||||
<para>Print one line command line help, similar to Usage above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</refsect1>
|
||||
<refsect1><title>Author</title>
|
||||
|
||||
<para>Gershon Elber.</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
@@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
|
||||
<html>
|
||||
<head>
|
||||
<link rev='made' href='mailto:esr@snark.thyrsus.com' />
|
||||
<meta name='MSSmartTagsPreventParsing' content='TRUE' />
|
||||
<title>The GIFLIB project</title>
|
||||
<script type="text/javascript">
|
||||
// JavaScript to generate a compact date representation
|
||||
|
||||
//
|
||||
// format date as yyyy-mm-dd
|
||||
//
|
||||
function date_ddmmmyyyy(date)
|
||||
{
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth() + 1;
|
||||
var y = date.getFullYear();
|
||||
|
||||
return "" + y + "-" + (m<10?"0"+m:m) + "-" + (d<10?"0"+d:d);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// get last modified date of the
|
||||
// current document.
|
||||
//
|
||||
function date_lastmodified()
|
||||
{
|
||||
var lmd = document.lastModified;
|
||||
var s = "Unknown";
|
||||
var d1;
|
||||
|
||||
// check if we have a valid date
|
||||
// before proceeding
|
||||
if(0 != (d1=Date.parse(lmd)))
|
||||
{
|
||||
s = "" + date_ddmmmyyyy(new Date(d1));
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
// End
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table width='100%' cellpadding='0' summary='Canned page header' bgcolor="#ddd">
|
||||
<tr>
|
||||
<td><h2>The GIFLIB project</h2></td>
|
||||
<td align="center"><img src="giflib-logo.gif"></td>
|
||||
<td align='right'><script type="text/javascript">
|
||||
document.write(date_lastmodified());
|
||||
</script></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>The GIFLIB project maintains the giflib service library, which has
|
||||
been pulling images out of GIFs since 1989. It is deployed everywhere
|
||||
you can think of and some places you probably can't - graphics
|
||||
applications and web browsers on multiple operating systems, game
|
||||
consoles, smartphones, and likely your ATM too.</p>
|
||||
|
||||
<p>Yes, this code is he reason GIFs were in Mosaic, the first web
|
||||
browser that could do inline graphics; it is the implementation
|
||||
Andreesen and Bina used.</p>
|
||||
|
||||
<p>This is very mature, stable, small-footprint code with minimal
|
||||
dependencies (suitable for use in embedded deployments) that needs only
|
||||
occasional very minor bugfixes. Test reports from odd platforms and
|
||||
better regression tests are particularly welcome. Don't try to
|
||||
redesign it, applications beyond counting would break if you did.</p>
|
||||
|
||||
<p>It's "GIFLIB" in caps as a nod to the code's origins in the dark
|
||||
and backward abysm of MS-DOS, but Unix hackers are encouraged to spell it
|
||||
"giflib" in deference to local conventions. :-)
|
||||
|
||||
<p>You can read GIFLIB's documentation <a href="intro.html">here</a>
|
||||
and a very detailed description of GIF <a
|
||||
href="whatsinagif/index.html">here</a>. People to thank for this code:
|
||||
Gershon Elber, Eric S. Raymond, Toshio Kuratomi.</p>
|
||||
|
||||
<p>Before October 2006 the GIF format was encumbered by patents on the
|
||||
LZW compression it uses. This first became an issue in 1993 when the
|
||||
patent-holders made ambiguous noises about requiring royalties. For
|
||||
some time a subset of this code travelled as "libungif", supporting
|
||||
decompression but not compression. You can read a more detailed
|
||||
history <a href="history.html">here</a>.</p>
|
||||
|
||||
<p>Note: The 5.x versions change the API slightly in a way that isn't
|
||||
compatible with older shared libraries. This was required to fix
|
||||
some known problems with the extensions API and with thread-safety.</p>
|
||||
|
||||
<p>If you require shared-library compatibility back to ancient
|
||||
versions, build from 4.2. 4.2 and the 5.0 version are behaviorally
|
||||
almost identical; the few differences are explained <a
|
||||
href="gif_lib.html#compatibility">here</a>.
|
||||
|
||||
<p>The SourceForge summary page (where you can download the source,
|
||||
review the project, find links to the bugtracker and mailing list
|
||||
pages, or ask to join the project as a developer) is <a
|
||||
href="https://sourceforge.net/projects/giflib/">here</a>.
|
||||
|
||||
<p>If you appreciate this project, and especially if you make money
|
||||
from it, please <a href="https://www.patreon.com/esr">support
|
||||
continuing maintainance on Patreon</a>.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
|
||||
<html>
|
||||
<head>
|
||||
<link rev='made' href='mailto:esr@snark.thyrsus.com' />
|
||||
<meta name='MSSmartTagsPreventParsing' content='TRUE' />
|
||||
<title>The GIFLIB project</title>
|
||||
<script type="text/javascript">
|
||||
// JavaScript to generate a compact date representation
|
||||
|
||||
//
|
||||
// format date ISO-fashion: yyyy-mm-dd
|
||||
//
|
||||
function date_ddmmmyyyy(date)
|
||||
{
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth() + 1;
|
||||
var y = date.getFullYear();
|
||||
|
||||
return "" + y + "-" + (m<10?"0"+m:m) + "-" + (d<10?"0"+d:d);
|
||||
}
|
||||
|
||||
//
|
||||
// get last modified date of the
|
||||
// current document.
|
||||
//
|
||||
function date_lastmodified()
|
||||
{
|
||||
var lmd = document.lastModified;
|
||||
var s = "Unknown";
|
||||
var d1;
|
||||
|
||||
// check if we have a valid date
|
||||
// before proceeding
|
||||
if(0 != (d1=Date.parse(lmd)))
|
||||
{
|
||||
s = "" + date_ddmmmyyyy(new Date(d1));
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
// End
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table width='100%' cellpadding='0' summary='Canned page header' bgcolor="#ddd">
|
||||
<tr>
|
||||
<td><h2>The GIFLIB project</h2></td>
|
||||
<td align="center"><img src="giflib-logo.gif"></td>
|
||||
<td align='right'><script type="text/javascript">
|
||||
document.write(date_lastmodified());
|
||||
</script></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>The GIFLIB project maintains the giflib service library, which has
|
||||
been pulling images out of GIFs since 1989. It is deployed everywhere
|
||||
you can think of and some places you probably can't - graphics
|
||||
applications and web browsers on multiple operating systems, game
|
||||
consoles, smartphones, and likely your ATM too.</p>
|
||||
|
||||
<p>Yes, this code is he reason GIFs were in Mosaic, the first web
|
||||
browser that could do inline graphics; it is the implementation
|
||||
Andreesen and Bina used.</p>
|
||||
|
||||
<p>This is very mature, stable, small-footprint code with minimal
|
||||
dependencies (suitable for use in embedded deployments) that needs only
|
||||
occasional very minor bugfixes. Test reports from odd platforms and
|
||||
better regression tests are particularly welcome. Don't try to
|
||||
redesign it, applications beyond counting would break if you did.</p>
|
||||
|
||||
<p>It's "GIFLIB" in caps as a nod to the code's origins in the dark
|
||||
and backward abysm of MS-DOS, but Unix hackers are encouraged to spell it
|
||||
"giflib" in deference to local conventions. :-)
|
||||
|
||||
<p>Before October 2006 the GIF format was encumbered by patents on the
|
||||
LZW compression it uses. This first became an issue in 1993 when the
|
||||
patent-holders made ambiguous noises about requiring royalties. For
|
||||
some time a subset of this code travelled as "libungif", supporting
|
||||
decompression but not compression. You can read a more detailed
|
||||
history <a href="history.html">here</a>.</p>
|
||||
|
||||
<p>Note: The 5.x versions change the API slightly in a way that isn't
|
||||
compatible with older shared libraries. This was required to fix
|
||||
some known problems with the extensions API and with thread-safety.</p>
|
||||
|
||||
<p>If you require shared-library compatibility back to ancient
|
||||
versions, build from 4.2. 4.2 and the 5.0 version are behaviorally
|
||||
almost identical; the few differences are explained <a
|
||||
href="gif_lib.html#compatibility">here</a>.
|
||||
|
||||
<p>The SourceForge summary page (where you can download the source,
|
||||
review the project, find links to the bugtracker and mailing list
|
||||
pages, or ask to join the project as a developer) is <a
|
||||
href="https://sourceforge.net/projects/giflib/">here</a>.
|
||||
|
||||
<p>People to thank for this code: Gershon Elber, Eric S. Raymond,
|
||||
Toshio Kuratomi.</p>
|
||||
|
||||
<p>If you appreciate this project, and especially if you make money
|
||||
from it, please <a href="https://www.patreon.com/esr">support
|
||||
continuing maintainance on Patreon</a>.</p>
|
||||
|
||||
<p>GIFLIB technical documentation:</p>
|
||||
<ul>
|
||||
<li><a href="intro.html">GIFLIB documentation</a></li>
|
||||
<li><a href="history.html">GIFLIB's history</a></li>
|
||||
<li><a href="gif_lib.html#compatibility">Difference between 4.2 and 5.0</a></li>
|
||||
<li><a href="https://sourceforge.net/projects/giflib/">SourceForge project page</a></li>
|
||||
<li><a href="https://www.patreon.com/esr">Support this project</a></li>
|
||||
</ul>
|
||||
|
||||
<p>GIF resources:</p>
|
||||
<ul>
|
||||
<li><a href="whatsinagif/index.html">What's In A GIF?</a></li>
|
||||
<li><a href="gifstandard/GIF89a.html">The GIF standard</a></li>
|
||||
<li><a href="gifstandard/LZW-and-GIF-explained.html">LZW and GIF explained</a></li>
|
||||
<li><a href="https://en.wikipedia.org/wiki/GIF">Wikipedia on GIF</a></li>
|
||||
</ul>
|
||||
|
||||
<p>To support this ubiquitous code, <a href="https://www.patreon.com/bePatron?u=962938" data-patreon-widget-type="become-patron-button">Become a Patreon patron!</a><script async src="https://c6.patreon.com/becomePatronButton.bundle.js"></script></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>Introduction to GIFLIB</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="article"><div class="titlepage"><div><div><h2 class="title"><a id="idm1"></a>Introduction to GIFLIB</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Eric</span> <span class="othername">Steven</span> <span class="surname">Raymond</span></h3><div class="affiliation"><span class="orgname"><a class="ulink" href="http://catb.org/~esr/" target="_top">
|
||||
Thyrsus Enterprises</a><br /></span><div class="address"><p><br />
|
||||
<code class="email"><<a class="email" href="mailto:esr@thyrsus.com">esr@thyrsus.com</a>></code><br />
|
||||
</p></div></div></div></div><div><p class="copyright">Copyright © 2012 Eric S. Raymond</p></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="#idm23">Utilities</a></span></dt><dd><dl><dt><span class="sect2"><a href="#idm27">Conversion Utilities</a></span></dt><dt><span class="sect2"><a href="#idm35">Test Pattern Generators</a></span></dt><dt><span class="sect2"><a href="#idm53">Image Manipulation Components</a></span></dt><dt><span class="sect2"><a href="#idm66">Report Generators</a></span></dt><dt><span class="sect2"><a href="#idm79">GIF Composition Tools</a></span></dt></dl></dd><dt><span class="sect1"><a href="#idm102">Library Functions</a></span></dt><dt><span class="sect1"><a href="#idm108">The GIF Standard</a></span></dt><dt><span class="sect1"><a href="#idm117">Package Status</a></span></dt></dl></div><p>GIFLIB is a package of portable tools and library routines for
|
||||
working with GIF images.</p><p>The Graphics Interchange Format(c) specification is the copyrighted
|
||||
property of CompuServe Incorporated. GIF(sm) is a service mark
|
||||
property of CompuServe Incorporated.</p><p>This package has been released under an X Consortium-like open-source
|
||||
license. Use and copy as you see fit. If you make useful changes,
|
||||
add new tools, or find and fix bugs, please send your mods to the
|
||||
maintainers for general distribution.</p><p>The util directory includes programs to clip, rotate, scale, and
|
||||
position GIF images. These are no replacement for an interactive graphics
|
||||
editor, but they can be very useful for scripted image generation or
|
||||
transformation.</p><p>The library includes program-callable entry points for reading and writing
|
||||
GIF files, an 8x8 utility font for embedding text in GIFs, and an error
|
||||
handler. GIF manipulation can be done at a relatively low level by
|
||||
sequential I/O (which automatically does/undoes image compression) or at
|
||||
a higher level by slurping an entire GIF into allocated core.</p><p>This library speaks both GIF87a and GIF89. The differences
|
||||
between GIF87 and GIF89 are minor: in the latter, the interpretation
|
||||
of some extension block types is defined. The library never needs to
|
||||
actually interpret these, but <a class="ulink" href="giftext.html" target="_top">giftext</a> notices them and there are
|
||||
functions in the API to read and modify them.</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm23"></a>Utilities</h2></div></div></div><p>Here is a summary of the utilities in this package. If you're looking
|
||||
at this page through a web browser, each utility name should be a
|
||||
hotlink to HTML documentation.</p><p>Most utilities have a -v (verbose) option that will cause them to print
|
||||
the current input scan line number (counting up) whenever they read
|
||||
image input, and will print output image line number (counting down)
|
||||
when they dump output. Utilities that only read or write always print
|
||||
in increasing order.</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm27"></a>Conversion Utilities</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><a class="ulink" href="gif2rgb.html" target="_top">gif2rgb</a></span></dt><dd><p>convert images saved as GIF to 24-bit RGB image(s) or vice-versa</p></dd></dl></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm35"></a>Test Pattern Generators</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><a class="ulink" href="gifbg.html" target="_top">gifbg</a></span></dt><dd><p>generate a single-color test pattern GIF</p></dd><dt><span class="term"><a class="ulink" href="gifcolor.html" target="_top">gifcolor</a></span></dt><dd><p>generate color test patterns</p></dd><dt><span class="term"><a class="ulink" href="gifwedge.html" target="_top">gifwedge</a></span></dt><dd><p>create a test GIF image resembling a color monitor test pattern</p></dd></dl></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm53"></a>Image Manipulation Components</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><a class="ulink" href="gifclrmp.html" target="_top">gifclrmp</a></span></dt><dd><p>modify GIF image colormaps</p></dd><dt><span class="term"><a class="ulink" href="giffix.html" target="_top">giffix</a></span></dt><dd><p>clumsily attempts to fix truncated GIF images</p></dd></dl></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm66"></a>Report Generators</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><a class="ulink" href="giftext.html" target="_top">giftext</a></span></dt><dd><p>print (text only) general information about a GIF</p></dd><dt><span class="term"><a class="ulink" href="gifhisto.html" target="_top">gifhisto</a></span></dt><dd><p>generate color-frequency histogram from a GIF</p></dd></dl></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idm79"></a>GIF Composition Tools</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><a class="ulink" href="gifbuild.html" target="_top">gifbuild</a></span></dt><dd><p>converter/deconverter to/from an editable text format</p></dd><dt><span class="term"><a class="ulink" href="gifecho.html" target="_top">gifecho</a></span></dt><dd><p>generate GIF images out of regular text in 8x8 font</p></dd><dt><span class="term"><a class="ulink" href="gifinto.html" target="_top">gifinto</a></span></dt><dd><p>end-of-pipe fitting for GIF-processing pipelines</p></dd><dt><span class="term"><a class="ulink" href="giftool.html" target="_top">giftool</a></span></dt><dd><p>GIF transformation tool</p></dd></dl></div></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm102"></a>Library Functions</h2></div></div></div><p>The library contains two groups of C functions. One group does
|
||||
sequential I/O on the stream-oriented GIF format. The other supports
|
||||
grabbing an entire GIF into allocated core, operating on it in core,
|
||||
and then writing the modified in-core GIF out to disk.</p><p>Unless you are on extremely memory-limited machine, you probably want
|
||||
to use the second group.</p><p>Detailed documentation on the library entry points is in <a class="ulink" href="gif_lib.html" target="_top">gif_lib.html</a>.</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm108"></a>The GIF Standard</h2></div></div></div><p>The doc subdirectory includes an <a class="ulink" href="gifstandard/GIF89a.html" target="_top">HTML presentation of the GIF
|
||||
standard</a>; an <a class="ulink" href="gifstandard/ LZW-and-GIF-explained.html" target="_top">explanation of Lempel-Ziv
|
||||
compression</a>, and the original flat-ASCII description of <a class="ulink" href="gifstandard/gif89.txt" target="_top">GIF89 format</a> . For historical
|
||||
completeness, we also include a copy of the <a class="ulink" href="gifstandard/gif87.txt" target="_top">GIF87 standard.</a></p><p>You can also read a <a class="ulink" href="whatsinagif/index.html" target="_top">
|
||||
detailed narrative description</a> of how GIFs are laid out. It
|
||||
clarifies some points on which the standard is obscure.</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idm117"></a>Package Status</h2></div></div></div><p>GIFLIB's current maintainer is Eric S. Raymond. You can find his home
|
||||
page at <a class="ulink" href="http://catb.org/~esr/" target="_top">http://catb.org/~esr/</a>.</p><p>GIFLIB is not under active development, but bug fixes are being
|
||||
accepted.</p></div></div></body></html>
|
||||
@@ -0,0 +1,221 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE article PUBLIC
|
||||
"-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
||||
<!ENTITY homepage "http://catb.org/~esr/">
|
||||
<!ENTITY email "esr@thyrsus.com">
|
||||
]>
|
||||
<article><title>Introduction to GIFLIB</title>
|
||||
|
||||
<articleinfo>
|
||||
|
||||
<author>
|
||||
<firstname>Eric</firstname>
|
||||
<othername>Steven</othername>
|
||||
<surname>Raymond</surname>
|
||||
<affiliation>
|
||||
<orgname><ulink url="&homepage;">
|
||||
Thyrsus Enterprises</ulink></orgname>
|
||||
<address>
|
||||
<email>&email;</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
<copyright>
|
||||
<year>2012</year>
|
||||
<holder role="mailto:&email;">Eric S. Raymond</holder>
|
||||
</copyright>
|
||||
|
||||
</articleinfo>
|
||||
|
||||
<para>GIFLIB is a package of portable tools and library routines for
|
||||
working with GIF images.</para>
|
||||
|
||||
<para>The Graphics Interchange Format(c) specification is the copyrighted
|
||||
property of CompuServe Incorporated. GIF(sm) is a service mark
|
||||
property of CompuServe Incorporated.</para>
|
||||
|
||||
<para>This package has been released under an X Consortium-like open-source
|
||||
license. Use and copy as you see fit. If you make useful changes,
|
||||
add new tools, or find and fix bugs, please send your mods to the
|
||||
maintainers for general distribution.</para>
|
||||
|
||||
<para>The util directory includes programs to clip, rotate, scale, and
|
||||
position GIF images. These are no replacement for an interactive graphics
|
||||
editor, but they can be very useful for scripted image generation or
|
||||
transformation.</para>
|
||||
|
||||
<para>The library includes program-callable entry points for reading and writing
|
||||
GIF files, an 8x8 utility font for embedding text in GIFs, and an error
|
||||
handler. GIF manipulation can be done at a relatively low level by
|
||||
sequential I/O (which automatically does/undoes image compression) or at
|
||||
a higher level by slurping an entire GIF into allocated core.</para>
|
||||
|
||||
<para>This library speaks both GIF87a and GIF89. The differences
|
||||
between GIF87 and GIF89 are minor: in the latter, the interpretation
|
||||
of some extension block types is defined. The library never needs to
|
||||
actually interpret these, but <ulink
|
||||
url="giftext.html">giftext</ulink> notices them and there are
|
||||
functions in the API to read and modify them.</para>
|
||||
|
||||
<sect1><title>Utilities</title>
|
||||
|
||||
<para>Here is a summary of the utilities in this package. If you're looking
|
||||
at this page through a web browser, each utility name should be a
|
||||
hotlink to HTML documentation.</para>
|
||||
|
||||
<para>Most utilities have a -v (verbose) option that will cause them to print
|
||||
the current input scan line number (counting up) whenever they read
|
||||
image input, and will print output image line number (counting down)
|
||||
when they dump output. Utilities that only read or write always print
|
||||
in increasing order.</para>
|
||||
|
||||
<!--
|
||||
Note: the giflib.1 man page is deliberately omitted from the following
|
||||
list of references. It's meant to be seen through man(1) only as part
|
||||
of a local installation of the tools.
|
||||
-->
|
||||
|
||||
<sect2><title>Conversion Utilities</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><ulink url="gif2rgb.html">gif2rgb</ulink></term>
|
||||
<listitem>
|
||||
<para>convert images saved as GIF to 24-bit RGB image(s) or vice-versa</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</sect2>
|
||||
<sect2><title>Test Pattern Generators</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><ulink url="gifbg.html">gifbg</ulink></term>
|
||||
<listitem>
|
||||
<para>generate a single-color test pattern GIF</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><ulink url="gifcolor.html">gifcolor</ulink></term>
|
||||
<listitem>
|
||||
<para>generate color test patterns</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><ulink url="gifwedge.html">gifwedge</ulink></term>
|
||||
<listitem>
|
||||
<para>create a test GIF image resembling a color monitor test pattern</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</sect2>
|
||||
<sect2><title>Image Manipulation Components</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><ulink url="gifclrmp.html">gifclrmp</ulink></term>
|
||||
<listitem>
|
||||
<para>modify GIF image colormaps</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><ulink url="giffix.html">giffix</ulink></term>
|
||||
<listitem>
|
||||
<para>clumsily attempts to fix truncated GIF images</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</sect2>
|
||||
<sect2><title>Report Generators</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><ulink url="giftext.html">giftext</ulink></term>
|
||||
<listitem>
|
||||
<para>print (text only) general information about a GIF</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><ulink url="gifhisto.html">gifhisto</ulink></term>
|
||||
<listitem>
|
||||
<para>generate color-frequency histogram from a GIF</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</sect2>
|
||||
<sect2><title>GIF Composition Tools</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><ulink url="gifbuild.html">gifbuild</ulink></term>
|
||||
<listitem>
|
||||
<para>converter/deconverter to/from an editable text format</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><ulink url="gifecho.html">gifecho</ulink></term>
|
||||
<listitem>
|
||||
<para>generate GIF images out of regular text in 8x8 font</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><ulink url="gifinto.html">gifinto</ulink></term>
|
||||
<listitem>
|
||||
<para>end-of-pipe fitting for GIF-processing pipelines</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><ulink url="giftool.html">giftool</ulink></term>
|
||||
<listitem>
|
||||
<para>GIF transformation tool</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</sect2>
|
||||
</sect1>
|
||||
<sect1><title>Library Functions</title>
|
||||
|
||||
<para>The library contains two groups of C functions. One group does
|
||||
sequential I/O on the stream-oriented GIF format. The other supports
|
||||
grabbing an entire GIF into allocated core, operating on it in core,
|
||||
and then writing the modified in-core GIF out to disk.</para>
|
||||
|
||||
<para>Unless you are on extremely memory-limited machine, you probably want
|
||||
to use the second group.</para>
|
||||
|
||||
<para>Detailed documentation on the library entry points is in <ulink
|
||||
url="gif_lib.html">gif_lib.html</ulink>.</para>
|
||||
|
||||
</sect1>
|
||||
<sect1><title>The GIF Standard</title>
|
||||
|
||||
<para>The doc subdirectory includes an <ulink
|
||||
url="gifstandard/GIF89a.html">HTML presentation of the GIF
|
||||
standard</ulink>; an <ulink url="gifstandard/
|
||||
LZW-and-GIF-explained.html">explanation of Lempel-Ziv
|
||||
compression</ulink>, and the original flat-ASCII description of <ulink
|
||||
url="gifstandard/gif89.txt">GIF89 format</ulink> . For historical
|
||||
completeness, we also include a copy of the <ulink
|
||||
url="gifstandard/gif87.txt">GIF87 standard.</ulink></para>
|
||||
|
||||
<para>You can also read a <ulink url="whatsinagif/index.html">
|
||||
detailed narrative description</ulink> of how GIFs are laid out. It
|
||||
clarifies some points on which the standard is obscure.</para>
|
||||
|
||||
</sect1>
|
||||
<sect1><title>Package Status</title>
|
||||
|
||||
<para>GIFLIB's current maintainer is Eric S. Raymond. You can find his home
|
||||
page at <ulink url="&homepage;">&homepage;</ulink>.</para>
|
||||
|
||||
<para>GIFLIB is not under active development, but bug fixes are being
|
||||
accepted.</para>
|
||||
|
||||
</sect1>
|
||||
</article>
|
||||
@@ -0,0 +1,505 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>What's In A GIF - Animation and Transparency</title>
|
||||
<script type="text/javascript"></script>
|
||||
<link rel="stylesheet" href="../proj.css" />
|
||||
<style type="text/css">
|
||||
.byte {font-family: Courier, fixed;
|
||||
padding: .2em}
|
||||
.gif_header {background-color: #f9E89D}
|
||||
.gif_screen {background-color: #C8DBD9}
|
||||
.gif_color {background-color: #E1E1E1}
|
||||
.gif_graphic {background-color: #F9EB9D}
|
||||
.gif_imgdesc {background-color: #C2D1DC}
|
||||
.gif_imgdata {background-color: #D0C4C4}
|
||||
.gif_trailer {background-color: #f9E89D}
|
||||
.gif_ext {background-color: #D0CFAE}
|
||||
#global_color_size {margin-left: auto; margin-right:auto; border:1px solid black;}
|
||||
#global_color_size td {text-align:center;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width='100%' cellpadding='0' summary='Canned page header' bgcolor="#ddd">
|
||||
<tr>
|
||||
<td><h2>What's In A GIF</h2></td>
|
||||
<td align="center"><img src="../giflib-logo.gif"></td>
|
||||
<td align="right">(animation and transparency)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="body">
|
||||
<div style="text-align:center; margin-top: 10px; padding-top: 10px; border-top: #cecece 1px solid">
|
||||
<p><a href="index.html">Back to the What's In A GIF index page.</a></p>
|
||||
</div>
|
||||
|
||||
<p>In addition to being able to store simple image data,
|
||||
GIF files (specifically GIF89a files) allow for some special features. Tricks
|
||||
such as transparency and animation can be accomplished with the
|
||||
help of the Graphics Control Extension block. Here's a sample of what this
|
||||
block looks like:</p>
|
||||
|
||||
<p style="text-align:center"><img src="graphic_control_ext.gif"
|
||||
alt="GIF graphics control ext block layout" style="border: 1px solid
|
||||
black" /></p>
|
||||
|
||||
<p>I'll show you how to manipulate the bytes in this block to achieve
|
||||
special effects.</p>
|
||||
|
||||
<h2><a name="animation">Animation</a></h2>
|
||||
|
||||
<p>Cartoons are created by animators who draw a sequence of pictures,
|
||||
each slightly different from the one before, which, when rapidly shown
|
||||
one after the other, give the illusion of motion. Animation in GIF
|
||||
images is achieved in much the same way. Multiple images may be stored
|
||||
in the same file and you can tell the computer how much time to wait
|
||||
before showing the next image. Let's walk though the parts that make
|
||||
up this simple traffic light animation.
|
||||
</p>
|
||||
|
||||
<p style="text-align:center"><img src="sample_2_animation.gif"
|
||||
alt="sample animated traffic light" / WIDTH="11" HEIGHT="29"></p>
|
||||
<p>
|
||||
|
||||
<span class="byte gif_header"> 47 </span>
|
||||
<span class="byte gif_header"> 49 </span>
|
||||
<span class="byte gif_header"> 46 </span>
|
||||
<span class="byte gif_header"> 38 </span>
|
||||
<span class="byte gif_header"> 39 </span>
|
||||
<span class="byte gif_header"> 61 </span>
|
||||
<span class="byte gif_screen"> 0B </span>
|
||||
<span class="byte gif_screen"> 00 </span>
|
||||
<span class="byte gif_screen"> 1D </span>
|
||||
<span class="byte gif_screen"> 00 </span>
|
||||
<span class="byte gif_screen"> A2 </span>
|
||||
<span class="byte gif_screen"> 05 </span>
|
||||
<span class="byte gif_screen"> 00 </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 8E </span>
|
||||
<span class="byte gif_color"> 8E </span>
|
||||
<span class="byte gif_color"> 8E </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_ext"> 21 </span>
|
||||
<span class="byte gif_ext"> FF </span>
|
||||
<span class="byte gif_ext"> 0B </span>
|
||||
<span class="byte gif_ext"> 4E </span>
|
||||
<span class="byte gif_ext"> 45 </span>
|
||||
<span class="byte gif_ext"> 54 </span>
|
||||
<span class="byte gif_ext"> 53 </span>
|
||||
<span class="byte gif_ext"> 43 </span>
|
||||
<span class="byte gif_ext"> 41 </span>
|
||||
<span class="byte gif_ext"> 50 </span>
|
||||
<span class="byte gif_ext"> 45 </span>
|
||||
<span class="byte gif_ext"> 32 </span>
|
||||
<span class="byte gif_ext"> 2E </span>
|
||||
<span class="byte gif_ext"> 30 </span>
|
||||
<span class="byte gif_ext"> 03 </span>
|
||||
<span class="byte gif_ext"> 01 </span>
|
||||
<span class="byte gif_ext"> 00 </span>
|
||||
<span class="byte gif_ext"> 00 </span>
|
||||
<span class="byte gif_ext"> 00 </span>
|
||||
<span class="byte gif_graphic"> 21 </span>
|
||||
<span class="byte gif_graphic"> F9 </span>
|
||||
<span class="byte gif_graphic"> 04 </span>
|
||||
<span class="byte gif_graphic"> 04 </span>
|
||||
<span class="byte gif_graphic"> 64 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 2C </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 0B </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 1D </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdata"> 03 </span>
|
||||
<span class="byte gif_imgdata"> 30 </span>
|
||||
<span class="byte gif_imgdata"> 48 </span>
|
||||
<span class="byte gif_imgdata"> BA </span>
|
||||
<span class="byte gif_imgdata"> DC </span>
|
||||
<span class="byte gif_imgdata"> DE </span>
|
||||
<span class="byte gif_imgdata"> 23 </span>
|
||||
<span class="byte gif_imgdata"> BE </span>
|
||||
<span class="byte gif_imgdata"> 48 </span>
|
||||
<span class="byte gif_imgdata"> 21 </span>
|
||||
<span class="byte gif_imgdata"> AD </span>
|
||||
<span class="byte gif_imgdata"> EB </span>
|
||||
<span class="byte gif_imgdata"> 62 </span>
|
||||
<span class="byte gif_imgdata"> A5 </span>
|
||||
<span class="byte gif_imgdata"> 25 </span>
|
||||
<span class="byte gif_imgdata"> D3 </span>
|
||||
<span class="byte gif_imgdata"> 93 </span>
|
||||
<span class="byte gif_imgdata"> F7 </span>
|
||||
<span class="byte gif_imgdata"> 8C </span>
|
||||
<span class="byte gif_imgdata"> E4 </span>
|
||||
<span class="byte gif_imgdata"> 27 </span>
|
||||
<span class="byte gif_imgdata"> 9A </span>
|
||||
<span class="byte gif_imgdata"> 1B </span>
|
||||
<span class="byte gif_imgdata"> D7 </span>
|
||||
<span class="byte gif_imgdata"> A1 </span>
|
||||
<span class="byte gif_imgdata"> 17 </span>
|
||||
<span class="byte gif_imgdata"> 9B </span>
|
||||
<span class="byte gif_imgdata"> 1E </span>
|
||||
<span class="byte gif_imgdata"> A0 </span>
|
||||
<span class="byte gif_imgdata"> F3 </span>
|
||||
<span class="byte gif_imgdata"> 96 </span>
|
||||
<span class="byte gif_imgdata"> 34 </span>
|
||||
<span class="byte gif_imgdata"> 13 </span>
|
||||
<span class="byte gif_imgdata"> DC </span>
|
||||
<span class="byte gif_imgdata"> CF </span>
|
||||
<span class="byte gif_imgdata"> AD </span>
|
||||
<span class="byte gif_imgdata"> 37 </span>
|
||||
<span class="byte gif_imgdata"> 7A </span>
|
||||
<span class="byte gif_imgdata"> 6F </span>
|
||||
<span class="byte gif_imgdata"> F7 </span>
|
||||
<span class="byte gif_imgdata"> B8 </span>
|
||||
<span class="byte gif_imgdata"> 05 </span>
|
||||
<span class="byte gif_imgdata"> 30 </span>
|
||||
<span class="byte gif_imgdata"> 28 </span>
|
||||
<span class="byte gif_imgdata"> F4 </span>
|
||||
<span class="byte gif_imgdata"> 39 </span>
|
||||
<span class="byte gif_imgdata"> 76 </span>
|
||||
<span class="byte gif_imgdata"> B5 </span>
|
||||
<span class="byte gif_imgdata"> 64 </span>
|
||||
<span class="byte gif_imgdata"> 02 </span>
|
||||
<span class="byte gif_imgdata"> 00 </span>
|
||||
<span class="byte gif_graphic"> 21 </span>
|
||||
<span class="byte gif_graphic"> F9 </span>
|
||||
<span class="byte gif_graphic"> 04 </span>
|
||||
<span class="byte gif_graphic"> 04 </span>
|
||||
<span class="byte gif_graphic"> 32 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 2C </span>
|
||||
<span class="byte gif_imgdesc"> 02 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 0B </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 07 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 10 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdata"> 03 </span>
|
||||
<span class="byte gif_imgdata"> 19 </span>
|
||||
<span class="byte gif_imgdata"> 78 </span>
|
||||
<span class="byte gif_imgdata"> 27 </span>
|
||||
<span class="byte gif_imgdata"> AC </span>
|
||||
<span class="byte gif_imgdata"> CB </span>
|
||||
<span class="byte gif_imgdata"> 0D </span>
|
||||
<span class="byte gif_imgdata"> CA </span>
|
||||
<span class="byte gif_imgdata"> 49 </span>
|
||||
<span class="byte gif_imgdata"> E1 </span>
|
||||
<span class="byte gif_imgdata"> B3 </span>
|
||||
<span class="byte gif_imgdata"> 0A </span>
|
||||
<span class="byte gif_imgdata"> BB </span>
|
||||
<span class="byte gif_imgdata"> CD </span>
|
||||
<span class="byte gif_imgdata"> F7 </span>
|
||||
<span class="byte gif_imgdata"> F8 </span>
|
||||
<span class="byte gif_imgdata"> CE </span>
|
||||
<span class="byte gif_imgdata"> 27 </span>
|
||||
<span class="byte gif_imgdata"> 1E </span>
|
||||
<span class="byte gif_imgdata"> 62 </span>
|
||||
<span class="byte gif_imgdata"> 69 </span>
|
||||
<span class="byte gif_imgdata"> 9E </span>
|
||||
<span class="byte gif_imgdata"> A3 </span>
|
||||
<span class="byte gif_imgdata"> 19 </span>
|
||||
<span class="byte gif_imgdata"> 82 </span>
|
||||
<span class="byte gif_imgdata"> 47 </span>
|
||||
<span class="byte gif_imgdata"> 02 </span>
|
||||
<span class="byte gif_imgdata"> 00 </span>
|
||||
<span class="byte gif_graphic"> 21 </span>
|
||||
<span class="byte gif_graphic"> F9 </span>
|
||||
<span class="byte gif_graphic"> 04 </span>
|
||||
<span class="byte gif_graphic"> 04 </span>
|
||||
<span class="byte gif_graphic"> 64 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 2C </span>
|
||||
<span class="byte gif_imgdesc"> 02 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 02 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 07 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 10 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdata"> 03 </span>
|
||||
<span class="byte gif_imgdata"> 19 </span>
|
||||
<span class="byte gif_imgdata"> 78 </span>
|
||||
<span class="byte gif_imgdata"> 07 </span>
|
||||
<span class="byte gif_imgdata"> AC </span>
|
||||
<span class="byte gif_imgdata"> CB </span>
|
||||
<span class="byte gif_imgdata"> 0D </span>
|
||||
<span class="byte gif_imgdata"> CA </span>
|
||||
<span class="byte gif_imgdata"> 49 </span>
|
||||
<span class="byte gif_imgdata"> E1 </span>
|
||||
<span class="byte gif_imgdata"> B3 </span>
|
||||
<span class="byte gif_imgdata"> 0A </span>
|
||||
<span class="byte gif_imgdata"> BB </span>
|
||||
<span class="byte gif_imgdata"> CD </span>
|
||||
<span class="byte gif_imgdata"> F7 </span>
|
||||
<span class="byte gif_imgdata"> F8 </span>
|
||||
<span class="byte gif_imgdata"> CE </span>
|
||||
<span class="byte gif_imgdata"> 27 </span>
|
||||
<span class="byte gif_imgdata"> 1E </span>
|
||||
<span class="byte gif_imgdata"> 62 </span>
|
||||
<span class="byte gif_imgdata"> 69 </span>
|
||||
<span class="byte gif_imgdata"> 9E </span>
|
||||
<span class="byte gif_imgdata"> A3 </span>
|
||||
<span class="byte gif_imgdata"> 19 </span>
|
||||
<span class="byte gif_imgdata"> 82 </span>
|
||||
<span class="byte gif_imgdata"> 45 </span>
|
||||
<span class="byte gif_imgdata"> 02 </span>
|
||||
<span class="byte gif_imgdata"> 00 </span>
|
||||
<span class="byte gif_trailer"> 3B </span>
|
||||
</p>
|
||||
|
||||
<p>This file is similar to the ones we've previously encountered. The
|
||||
bytes start out with the GIF header. Next we have a <a
|
||||
href="bits_and_bytes.html#logical_screen_descriptor_block">logical
|
||||
screen descriptor</a> which tells us that our image is 11px by 29 px
|
||||
and will have a global color table with 8 colors in it (of which we
|
||||
only really need 5). Immediately after, follows the global color table
|
||||
which tells us what those colors are (0=red, 1=green, 2=yellow,
|
||||
3=light grey, 4=black, 5=white, 6=black [not used], 7=black [not used]
|
||||
).</p>
|
||||
|
||||
<p>Next we encounter an <a
|
||||
href="bits_and_bytes.html#application_extension_block">application
|
||||
extension block</a>. This is this block that causes our animation to
|
||||
repeat rather than play once and stop. The first three bytes tell us
|
||||
we are looking at (1) an extension block (2) of type
|
||||
"application" which is followed by (3) 11 bytes of fixed
|
||||
length data. These 11 bytes contain the ASCII character codes for
|
||||
"NETSCAPE2.0". Then begins the actual "application
|
||||
data" which is contained in sub-blocks. There are two values that
|
||||
are stored in these sub-blocks. The first value is always the byte
|
||||
<span class="byte">01</span>. Then we have a value in the unsigned
|
||||
(lo-hi byte) format that says how many times the animation should
|
||||
repeat. You can see that our sample image has a value of 0; this means
|
||||
the animation should loop forever. These three bytes are preceded by
|
||||
the <span class="byte">03</span> that lets the decoder know that three
|
||||
bytes of data follow, and they are terminated by <span
|
||||
class="byte">00</span>, the block terminator.</p>
|
||||
|
||||
<p>This very basic animation is essentially made up of three different
|
||||
"scenes". The first is the one with the green light lit,
|
||||
the second with the yellow, and the last with the red. You should be
|
||||
able to see three separate chunks of image data in the bytes
|
||||
above. </p>
|
||||
|
||||
<table style="margin-left: auto;margin-right: auto">
|
||||
<tr><th>1</th><th>2</th><th>3</th></tr>
|
||||
<tr>
|
||||
<td><img src="sample_2_animation_green.gif" alt="scene 1: green light" width="11" height="29"/></td>
|
||||
<td><img src="sample_2_animation_yellow.gif" alt="scene 2: yellow light" width="11" height="29"/></td>
|
||||
<td><img src="sample_2_animation_red.gif" alt="scene 3: red light" width="11" height="29"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>The first chunk begins immediately after the application extension
|
||||
block. It is there we encounter our first graphic control
|
||||
extension. As with all extensions, it begins with <span
|
||||
class="byte">21</span>. Next, the type specific label for the graphic
|
||||
control type of extension is <span class="byte">F9</span>. Next we see
|
||||
the byte size of the data in the block; this should always be <span
|
||||
class="byte">04</span>. The first of these four data blocks is a
|
||||
packed field. </p>
|
||||
|
||||
<p>The packed field stores three values. The first three (highest)
|
||||
bits are "reserved for future use" so those have been left
|
||||
as zeros. The next three bits indicate the disposal method. The
|
||||
<em>disposal method</em> specifies what happens to the current image
|
||||
data when you move onto the next. We have three bits which means we
|
||||
can represent a number between 0 and 7. Our sample animated image has
|
||||
a value of 1 which tells the decoder to leave the image in place and
|
||||
draw the next image on top of it. A value of 2 would have meant that
|
||||
the canvas should be restored to the background color (as indicated by
|
||||
the logical screen descriptor). A value of 3 is defined to mean that
|
||||
the decoder should restore the canvas to its previous state before the
|
||||
current image was drawn. I don't believe that this value is widely
|
||||
supported but haven't had the chance to test it out. The behavior for
|
||||
values 4-7 are yet to be defined. If this image were not animated,
|
||||
these bits would have been set to 0 which indicates that do not wish
|
||||
to specify a disposal method. The seventh bit in they byte is the
|
||||
<em>user input flag</em>. When set to 1, that means that the decoder
|
||||
will wait for some sort of "input" from the person viewing
|
||||
the image before moving on to the next scene. I'm guessing it's highly
|
||||
unlikeley that you will encounter any other value that 0 for this bit.
|
||||
The final bit is the transparency flag. We will go into more detail
|
||||
about transparency in <a href="#transparency">the next
|
||||
section</a>. Since this image isn't using any transparency, we see
|
||||
this bit has been left at 0. </p>
|
||||
|
||||
<p>The next two bytes are the delay time. This value is in the same
|
||||
unsigned lformat as all the other integers in the file. This number
|
||||
represents the number of hundredths of a second to wait before moving
|
||||
on to the next scene. We see that our sample image has specified
|
||||
a value of 100 (<span class="byte">64</span> <span class="byte">00</span>)
|
||||
in the first graphics control block which means we would wait 1 second
|
||||
before changing our green light to yellow.</p>
|
||||
|
||||
<p>Our graphics control extension block ends with the block
|
||||
terminator <span class="byte">00</span>. You will notice this
|
||||
type of block appearing two more times in this image, the second
|
||||
instance differing only in the delay time (the yellow light only
|
||||
stays up for half a second).</p>
|
||||
|
||||
<p>The next chunk is an image descriptor. The block declares that it
|
||||
will be drawing an image starting at the top left corner and taking up
|
||||
the whole canvas (11px x 29px). This block is followed by the image
|
||||
data that contains all the codes to draw the first scene, the one with
|
||||
the green light on.</p>
|
||||
|
||||
<table style="margin-left: auto;margin-right: auto; text-align: center">
|
||||
<tr><th>Green</th><th>(Difference)</th><th>Yellow</th></tr>
|
||||
<tr>
|
||||
<td><img src="sample_2_green_large.gif" alt="green light enlarged" width="33" height="87"/></td>
|
||||
<td><img src="sample_2_green_yellow_diff.gif" alt="difference between green and yellow images"width="33" height="87"/></td>
|
||||
<td><img src="sample_2_yellow_large.gif" alt="yellow light enlarged" width="33" height="87"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>If we compare the first and the second scene, we see they share many
|
||||
of the same pixel color values. Rather than redrawing the whole canvas,
|
||||
we can specify just the part that changes (that is, the smallest
|
||||
rectangle that covers the part that changes). You'll see that the
|
||||
image descriptor before the second block of image data specifies
|
||||
that it will start at the pixel at (2, 11) and draws a box that's
|
||||
7px wide by 16px tall. This is just large enough to cover the bottom two
|
||||
lights. The works because we chose the "do not dispose" disposal
|
||||
method for out graphics control extension block. In the same way,
|
||||
the third and final image data block only renders the top two circles
|
||||
to both fill in the red and cover up the yellow.</p>
|
||||
|
||||
<h2><a name="transparency">Transparency</a></h2>
|
||||
|
||||
<p>Normally, GIF images are rectangles that cover up what ever
|
||||
background may be beneath them. Transparency allows you to "see
|
||||
though" the image to whatever is below. This is a very simple
|
||||
trick to pull off in a GIF image. You can set up one color in your
|
||||
color table that is converted to "invisible ink." Then, as
|
||||
the image is drawn, whenever this special color is encountered, the
|
||||
background is allowed to show through.</p>
|
||||
|
||||
<p>There are only two pieces of data we have to set to pull this
|
||||
off. First we must set the Transparency Color Flag to 1. This is the
|
||||
lowest bit in the packed byte of the Graphic Control Extension. This
|
||||
will tell the decoder that we want our image to have a transparent
|
||||
component. Secondly we must tell the decoder which color we want to
|
||||
use as our invisible ink. The decoder will then all you to see thought
|
||||
every pixel that contains this color. Therefore make sure it's not a
|
||||
color that you are using else where in your image. The color you
|
||||
choose must be in the active color table and you specify its value in
|
||||
the Transparent Color Index byte by setting this value to the index of
|
||||
the color in the color table.</p>
|
||||
|
||||
<p>Let's demonstrate this by revisiting the sample image we used
|
||||
in <a href="bits_and_bytes.html">Bits and Bytes</a>. We will update this
|
||||
file to make the white center part transparent. Let's start creating
|
||||
the Graphic Control Extension block that will do this for us. Again we
|
||||
start with the <span class="byte">21</span> <span class="byte">F9</span>
|
||||
<span class="byte">04</span> punch. In the next byte, we need to flip
|
||||
the transparent color flag to 1 (we can leave the others at zero) so
|
||||
this whole byte is simply <span class="byte">01</span>. The next two
|
||||
bytes can be left at zero.</p>
|
||||
|
||||
<p>We must now specify which color to disappear. Recall that our
|
||||
sample image had the following global color table:</p>
|
||||
|
||||
<table style="margin-left: auto; margin-right: auto">
|
||||
<tr><th>Index</th><th>Color</th></tr>
|
||||
<tr><td>0</td><td><span style="color:#FFFFFF; background: #000000; font-weight: bold">White</span></td></tr>
|
||||
<tr><td>1</td><td><span style="color:#FF0000; font-weight: bold">Red</span></td></tr>
|
||||
<tr><td>2</td><td><span style="color:#0000FF; font-weight: bold">Blue</span></td></tr>
|
||||
<tr><td>3</td><td><span style="font-weight: bold">Black</span></td></tr>
|
||||
</table>
|
||||
|
||||
<p>We already know what we want to make all the white sections
|
||||
transparent. The color white has an index of 0. Therefore we will
|
||||
specify a value of <span class="byte">00</span> for the transparent
|
||||
color index block. Had we wanted to make the red transparent we would
|
||||
have used <span class="byte">01</span>, or <span
|
||||
class="byte">02</span> for blue. Lastly we tack on the block
|
||||
terminator of <span class="byte">00</span> and we're done. We have
|
||||
created the following block:</p>
|
||||
|
||||
<p>
|
||||
<span class="byte gif_graphic"> 21 </span>
|
||||
<span class="byte gif_graphic"> F9 </span>
|
||||
<span class="byte gif_graphic"> 04 </span>
|
||||
<span class="byte gif_graphic"> 01 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
</p>
|
||||
|
||||
<p>Now, all we have to do is plug this into our sample image right before the
|
||||
image descriptor. I've placed our original sample image on a black background
|
||||
as well as the one we just made so you can see the results. I've also included
|
||||
ones where red or blue are transparent. The last three differ by only the
|
||||
transparent color index byte.</p>
|
||||
|
||||
<table cellpadding="10px" style="text-align: center; margin-left: auto; margin-right: auto">
|
||||
<tr>
|
||||
<th style="width:25%">Original</th>
|
||||
<th style="width:25%">Transparent <br/>
|
||||
White (<span class="byte">00</span>)</th>
|
||||
<th style="width:25%">Transparent <br/>
|
||||
Red (<span class="byte">01</span>)</th>
|
||||
<th style="width:25%">Transparent <br/>
|
||||
Blue (<span class="byte">02</span>)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:25%; background-color: black">
|
||||
<img src="sample_1.gif" alt="previous sample" width="10" height="10"/></td>
|
||||
<td style="width:25%; background-color: black">
|
||||
<img src="sample_1_trans.gif" alt="transparent white" width="10" height="10"/></td>
|
||||
<td style="width:25%; background-color: black">
|
||||
<img src="sample_1_trans_red.gif" alt="transparent red" width="10" height="10"/></td>
|
||||
<td style="width:25%; background-color: black">
|
||||
<img src="sample_1_trans_blue.gif" alt="transparent blue" width="10" height="10"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>This concludes our description of the bits inside GIFs. If you
|
||||
have not already read the <a href="../gif_lib.html">documentation of
|
||||
the GIFLIB API</a>, you may wish to continue with that.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="text-align:center; margin-top: 10px; padding-top: 10px; border-top: #cecece 1px solid">
|
||||
<a href="../index.html">Back to GIFLIB documentation</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,687 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>What's In A GIF - Bits and Bytes</title>
|
||||
<script type="text/javascript"></script>
|
||||
<link rel="stylesheet" href="../proj.css" />
|
||||
<style type="text/css">
|
||||
.byte {font-family: Courier, fixed;
|
||||
padding: .2em}
|
||||
.gif_header {background-color: #f9E89D}
|
||||
.gif_screen {background-color: #C8DBD9}
|
||||
.gif_color {background-color: #E1E1E1}
|
||||
.gif_graphic {background-color: #F9EB9D}
|
||||
.gif_imgdesc {background-color: #C2D1DC}
|
||||
.gif_imgdata {background-color: #D0C4C4}
|
||||
.gif_trailer {background-color: #f9E89D}
|
||||
.gif_ext {background-color: #D0CFAE}
|
||||
#global_color_size {margin-left: auto; margin-right:auto; border:1px solid black;}
|
||||
#global_color_size td {text-align:center;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width='100%' cellpadding='0' summary='Canned page header' bgcolor="#ddd">
|
||||
<tr>
|
||||
<td><h2>What's In A GIF</h2></td>
|
||||
<td align="center"><img src="../giflib-logo.gif"></td>
|
||||
<td align="right">(Bits and bytes)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="body">
|
||||
<div style="text-align:center; margin-top: 10px; padding-top: 10px; border-top: #cecece 1px solid">
|
||||
<p><a href="index.html">Back to the What's In A GIF index page.</a></p>
|
||||
</div>
|
||||
|
||||
<p>The authority on the content of GIFs is the <a
|
||||
href="../gif89.txt">GIF89a specification</a>. Originally developed at
|
||||
CompuServe in the late 1980s, it is now a W3C standard.</p>
|
||||
|
||||
<p>A GIF file is made up of a sequence of data blocks. The first two
|
||||
blocks are fixed length and fixed format. Later ones are variable
|
||||
length but self-describing; they consisting of a byte identifying the block
|
||||
type, followed by a payload length byte, followed by payload.</p>
|
||||
|
||||
<p>The following railroad diagram shows all of the different types of
|
||||
blocks and where they can be in the file. Every path following the
|
||||
arrows corresponds to a valid block sequence. The large middle
|
||||
secction, in particular, can be repeated any number of times.</p>
|
||||
|
||||
<p style="text-align:center"><img src="gif_file_stream.gif" alt="GIF file stream diagram" style="border: 1px solid black" / WIDTH="700" HEIGHT="220"></p>
|
||||
|
||||
<p>We will learn more by walking through a sample GIF file. You can
|
||||
see the sample file and its corresponding bytes below. </p>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td style="text-align:center; vertical-align: top; padding: 5px; width:20%"><h3>Actual Size</h3><img src="sample_1.gif" alt="sample gif, actual size" title="Actual Size" style="padding: 20px" / WIDTH="10" HEIGHT="10"><br/>(10x10)</td>
|
||||
<td style="text-align:center; vertical-align: top; padding: 5px;; width:20%"><h3>Enlarged</h3><img src="sample_1_enlarged.gif" alt="sample gif, enlarged" title="Enlarged" / WIDTH="100" HEIGHT="100"><br/>(100x100)</td>
|
||||
<td style="vertical-align: top; padding: 5px; width:60%"><h3>Bytes</h3>
|
||||
|
||||
<span class="byte gif_header"> 47 </span>
|
||||
<span class="byte gif_header"> 49 </span>
|
||||
<span class="byte gif_header"> 46 </span>
|
||||
<span class="byte gif_header"> 38 </span>
|
||||
<span class="byte gif_header"> 39 </span>
|
||||
<span class="byte gif_header"> 61 </span>
|
||||
<span class="byte gif_screen"> 0A </span>
|
||||
<span class="byte gif_screen"> 00 </span>
|
||||
<span class="byte gif_screen"> 0A </span>
|
||||
<span class="byte gif_screen"> 00 </span>
|
||||
<span class="byte gif_screen"> 91 </span>
|
||||
<span class="byte gif_screen"> 00 </span>
|
||||
<span class="byte gif_screen"> 00 </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_graphic"> 21 </span>
|
||||
<span class="byte gif_graphic"> F9 </span>
|
||||
<span class="byte gif_graphic"> 04 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 2C </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 0A </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 0A </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdata"> 02 </span>
|
||||
<span class="byte gif_imgdata"> 16 </span>
|
||||
<span class="byte gif_imgdata"> 8C </span>
|
||||
<span class="byte gif_imgdata"> 2D </span>
|
||||
<span class="byte gif_imgdata"> 99 </span>
|
||||
<span class="byte gif_imgdata"> 87 </span>
|
||||
<span class="byte gif_imgdata"> 2A </span>
|
||||
<span class="byte gif_imgdata"> 1C </span>
|
||||
<span class="byte gif_imgdata"> DC </span>
|
||||
<span class="byte gif_imgdata"> 33 </span>
|
||||
<span class="byte gif_imgdata"> A0 </span>
|
||||
<span class="byte gif_imgdata"> 02 </span>
|
||||
<span class="byte gif_imgdata"> 75 </span>
|
||||
<span class="byte gif_imgdata"> EC </span>
|
||||
<span class="byte gif_imgdata"> 95 </span>
|
||||
<span class="byte gif_imgdata"> FA </span>
|
||||
<span class="byte gif_imgdata"> A8 </span>
|
||||
<span class="byte gif_imgdata"> DE </span>
|
||||
<span class="byte gif_imgdata"> 60 </span>
|
||||
<span class="byte gif_imgdata"> 8C </span>
|
||||
<span class="byte gif_imgdata"> 04 </span>
|
||||
<span class="byte gif_imgdata"> 91 </span>
|
||||
<span class="byte gif_imgdata"> 4C </span>
|
||||
<span class="byte gif_imgdata"> 01 </span>
|
||||
<span class="byte gif_imgdata"> 00 </span>
|
||||
<span class="byte gif_trailer"> 3B </span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>Note that not all possible block types are represented in this
|
||||
sample file. Later we'll provide samples of missing block types where
|
||||
appropriate. The different types of blocks include: <a
|
||||
href="#header_block">header</a>, <a
|
||||
href="#logical_screen_descriptor_block">logical screen descriptor</a>,
|
||||
<a href="#global_color_table_block">global color table</a>, <a
|
||||
href="#graphics_control_extension_block">graphics control
|
||||
extension</a>, <a href="#image_descriptor_block">image descriptor</a>,
|
||||
<a href="#local_color_table_block">local color table</a>, <a
|
||||
href="#image_data_block">image data</a>, <a
|
||||
href="#plain_text_extension_block">plain text extension</a>, <a
|
||||
href="#application_extension_block">application extension</a>, <a
|
||||
href="#comment_extension_block">comment extension</a>, and <a
|
||||
href="#trailer_block">trailer</a>. Let's get started with the first
|
||||
block!</p>
|
||||
|
||||
<h2><a name="header_block">Header Block</a></h2>
|
||||
|
||||
<p>From the sample file:
|
||||
<span class="byte gif_header"> 47 </span>
|
||||
<span class="byte gif_header"> 49 </span>
|
||||
<span class="byte gif_header"> 46 </span>
|
||||
<span class="byte gif_header"> 38 </span>
|
||||
<span class="byte gif_header"> 39 </span>
|
||||
<span class="byte gif_header"> 61 </span>
|
||||
</p>
|
||||
|
||||
<p>All GIF files must start with a header block. The header takes up
|
||||
the first six bytes of the file. These bytes should all correspond to
|
||||
<a href="http://www.ascii.cl/">ASCII character codes</a>. The first
|
||||
three bytes are called the <strong>signature</strong>. These should
|
||||
always be "GIF" (ie 47="G", 49="I",
|
||||
46="F"). The next three specify the <strong>version</strong>
|
||||
of the specification that was used to encode the image.
|
||||
|
||||
<p>Normally the version string will be either "89a" (ie
|
||||
38="8", 39="9",61="a") or "87a" (ie
|
||||
38="8", 37="7",61="a"). All modern
|
||||
GIF-processing software recognizes both versions, For maximum
|
||||
compatibility, GIFLIB will normally write an 87a signature unless the
|
||||
file contains GIF89 features.</p>
|
||||
|
||||
<p style="text-align:center"><img src="header_block.gif" alt="GIF header block layout" style="border: 1px solid black" /></p>
|
||||
|
||||
<h2><a name="logical_screen_descriptor_block">Logical Screen Descriptor</a></h2>
|
||||
<p>From Sample File: <span class="byte gif_screen"> 0A </span>
|
||||
<span class="byte gif_screen"> 00 </span><span class="byte gif_screen"> 0A </span><span class="byte gif_screen"> 00 </span><span class="byte gif_screen"> 91 </span><span class="byte gif_screen"> 00 </span><span class="byte gif_screen"> 00 </span></p>
|
||||
|
||||
<p>The logical screen descriptor always immediately follows the
|
||||
header. This block tells the decoder how much room this image will
|
||||
take up. It is exactly seven bytes long. It starts with the
|
||||
<strong>canvas width</strong> and <strong>canvas height</strong>.
|
||||
These value can be found in the first two pairs of two bytes each.
|
||||
Both are 16-bit, nonnegative integers (0-65,535).</p>
|
||||
|
||||
<p>As with all the other multi-byte values in the GIF format, the
|
||||
least significant byte is stored first (little-endian format). This
|
||||
means where we would read <span class="byte"> 0A </span><span
|
||||
class="byte"> 00 </span> from the byte stream, we would normally write
|
||||
it as <span class="byte">000A</span> which is the same as 10. Thus the
|
||||
width of our sample image is 10 pixels. As a further example 255 would
|
||||
be stored as <span class="byte"> FF </span><span class="byte"> 00
|
||||
</span> but 256 would be <span class="byte"> 00 </span><span
|
||||
class="byte"> 01 </span>.</p>
|
||||
|
||||
<p>The canvas width and height are usually ignored by modern viewers.
|
||||
The GIF format seems to have been designed with the idea that viewers
|
||||
would render multiple images in a GIF on a common canvas, giving an
|
||||
effect like a picture wall. But nowadays multiple-image GIFs are
|
||||
generally used either as animations in which each sub-image is a frame
|
||||
or as image libraries, with the GIF client handling compositing into
|
||||
some canvas about which the GIF format holds no information.Thus, the
|
||||
canvas width and height are mainly fossils. GIFLIB does extract them
|
||||
and allow you to set them, however.</p>
|
||||
|
||||
<p>The next byte contains four fields of packed data, the "logical
|
||||
screen descriptor". To understand these, we need to expand the byte
|
||||
<span class="byte"> 91 </span> to binary as <span
|
||||
class="byte">10010001</span> and look at the fields inside it.</p>
|
||||
|
||||
<p style="text-align:center"><img src="logical_screen_desc_block.gif" alt="GIF logical screen descriptor block layout" style="border: 1px solid black" /></p>
|
||||
|
||||
<p>The first (most-significant) bit is the <strong>global color table
|
||||
flag</strong>. If it's 0, then there is no global color table. If it's
|
||||
1, then a global color table will follow. In our sample image, we can
|
||||
see that we will have a global color table (as will usually be the
|
||||
case).<p>
|
||||
|
||||
<p>The next three bits are the <strong>color resolution</strong>. They
|
||||
are only meaningful if there is a global color table, and allow you to
|
||||
compute its size. If the value of this filed is N, the number of
|
||||
entries in the global color table will be 2 ^ (N+1) - that is, two
|
||||
raised to the power (N+1). Thus, the <span class="byte">001</span> in
|
||||
the sample image represents 2 bits/pixel; <span
|
||||
class="byte">111</span> would represent 8 bits/pixel.</p>
|
||||
|
||||
<p>The GIF format shows its age here. A more modern design would
|
||||
simply have allocated a byte or two for color table length. But GIF
|
||||
was designed when memory was much more expensive than it is today,
|
||||
and the designers felt strong pressure to economize on every bit.
|
||||
The consequence is that color table lengths have to be an exact power
|
||||
of two. Perversely, this can force a waste of memory space in images
|
||||
with odd color counts.</p>
|
||||
|
||||
<p>The next single bit is the <strong>sort flag</strong>. If the
|
||||
values is 1, then the colors in the global color table are sorted in
|
||||
order of "decreasing importance," which typically means
|
||||
"decreasing frequency" in the image. This can help the image
|
||||
decoder, but is not required. In the sample file this value has been
|
||||
left at 0.</p>
|
||||
|
||||
<p>The sort flag reflected the high cost of dual-port memory at the
|
||||
time the GIF specification was written in the late 1980s. That kind
|
||||
of limit disappeared in the mid-1990s, and modern GIF software ignores
|
||||
this flag. Until version 5.0, GIFLIB ignored it on input and zeroed
|
||||
it on output; 5.0 and later versions read and preserve it.</p>
|
||||
|
||||
<p>The next byte gives us the <strong>background color
|
||||
index</strong>. This byte is only meaningful if the global color table
|
||||
flag is 1, and if there is no global color table, this byte should be
|
||||
0.. To understand it you have to remember the original "picture wall"
|
||||
rendering model for GIFs in which sub-images are composited onto a
|
||||
larger canvas. It represents which index in the global color table
|
||||
should be used for pixels on the virtual canvas that aren't overlayed
|
||||
by an image. GIFLIB supports reading and setting this byte, but modern
|
||||
viewers and browsers generally have no use for it.</p>
|
||||
|
||||
<p>The last byte of the logical screen descriptor is the <strong>pixel
|
||||
aspect ratio</strong>. Modern viewers don't use this. Until 5.0,
|
||||
GIFLIB ignored this flag on input and zeroed it on output; now it is
|
||||
read and preserved if present. The GIF standard doesn't give a
|
||||
rationale for it, but it seems likely that the designers intended it
|
||||
for representing image captures from the analog television of the day,
|
||||
which had rectangular pixel-equivalents. The GIF specification says
|
||||
that if there was a value specified in this byte, N, the actual ratio
|
||||
used would be (N + 15) / 64 for all N<>0.</p>
|
||||
|
||||
<h2><a name="global_color_table_block">Global Color Table</a></h2>
|
||||
|
||||
<p>From the sample file:
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> FF </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
<span class="byte gif_color"> 00 </span>
|
||||
</p>
|
||||
|
||||
<p>GIFs can have either a <strong>global color table</strong> or local
|
||||
color tables for each sub-image. Each color table consists of a list
|
||||
of RGB (Red-Green-Blue) color component intensities, three bytes for
|
||||
each color, with intensities ranging from 0 (least) to 255 (most). The
|
||||
color (0,0,0) is deepest black, the color (255,255,255) brightest
|
||||
white. The other extreme colors are red at (255,0,0), green at
|
||||
(0,255,0) and blue at (0,0,255).</p>
|
||||
|
||||
<p>As previously noted, the length of the global color table is
|
||||
2^(N+1) entries where N is the value of the color depth field in the
|
||||
logical screen descriptor. The table will take up 3*2^(N+1) bytes in
|
||||
the stream.</p>
|
||||
|
||||
<div style="text-align:center">
|
||||
<table id="global_color_size">
|
||||
<tr><th>Size In Logical<br/>Screen Desc</th><th>Number Of<br/>Colors</th><th>Byte<br/>Length</th></tr>
|
||||
<tr><td>0</td><td>2</td><td>6</td></tr>
|
||||
<tr><td>1</td><td>4</td><td>12</td></tr>
|
||||
<tr><td>2</td><td>8</td><td>24</td></tr>
|
||||
<tr><td>3</td><td>16</td><td>48</td></tr>
|
||||
<tr><td>4</td><td>32</td><td>96</td></tr>
|
||||
<tr><td>5</td><td>64</td><td>192</td></tr>
|
||||
<tr><td>6</td><td>128</td><td>384</td></tr>
|
||||
<tr><td>7</td><td>256</td><td>768</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p>Our sample file has a global color table size of 1. This means it
|
||||
holds 2^(1+1)=2^2=4 colors. We can see that it takes up 12, (3*4),
|
||||
bytes as expected. We read the bytes three at a time to get each of
|
||||
the colors. The first color is #FFFFFF (white). This value is given an
|
||||
index of 0. The second color is #FF0000 (red). The color with an
|
||||
index value of 2 is #0000FF (blue). The last color is #000000
|
||||
(black). The index numbers will be important when we decode the actual
|
||||
image data.</p>
|
||||
|
||||
<p>Note that this block is labeled as "optional." Not every
|
||||
GIF has to specify a global color table. However, if the global color
|
||||
table flag is set to 1 in the logical screen descriptor block, the
|
||||
color table is then required to immediately follow that block.
|
||||
</p>
|
||||
|
||||
<p style="text-align:center"><img src="global_color_table.gif" alt="GIF global color table block layout" style="border: 1px solid black" /></p>
|
||||
|
||||
<h2><a name="graphics_control_extension_block">Graphics Control Extension</a></h2>
|
||||
|
||||
<p>From the sample file:
|
||||
<span class="byte gif_graphic"> 21</span>
|
||||
<span class="byte gif_graphic"> F9 </span>
|
||||
<span class="byte gif_graphic"> 04 </span>
|
||||
<span class="byte gif_graphic"> 00</span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
<span class="byte gif_graphic"> 00</span>
|
||||
<span class="byte gif_graphic"> 00 </span>
|
||||
</p>
|
||||
|
||||
<p>Graphic control extension blocks are used to specify transparency
|
||||
settings and control animations. They are an optional GIF89 extension.
|
||||
The semantics of this extension will be described in detail in a later section
|
||||
(see <a href="animation_and_transparency.html">Transparency and Animation</a>);
|
||||
for completeness we'll describe the data fields here.</p>
|
||||
|
||||
<p>The first byte is the <strong>extension introducer</strong>. All
|
||||
<em>extension</em> blocks begin with <span
|
||||
class="byte">21</span>. Next is the <strong>graphic control
|
||||
label</strong>, <span class="byte">F9</span>, which is the value that
|
||||
flags this as a graphic control extension. Third up is the total
|
||||
<strong>block size</strong> in bytes. Next is a packed field. Bits 1-3
|
||||
are reserved for future use. Bits 4-6 indicate <strong>disposal
|
||||
method</strong>. The penultimate bit is the <strong>user input
|
||||
flag</strong> and the last is the <strong>transparent color
|
||||
flag</strong>. The <strong>delay time</strong> value follows in the
|
||||
next two bytes stored in unsigned format. After that we have the
|
||||
<strong>transparent color index</strong> byte. Finally we have the
|
||||
<strong>block terminator</strong> which is always <span
|
||||
class="byte">00</span>.</p>
|
||||
|
||||
<p style="text-align:center"><img src="graphic_control_ext.gif"
|
||||
alt="GIF graphic control extension block layout" style="border: 1px
|
||||
solid black" /></p>
|
||||
|
||||
<h2><a name="image_descriptor_block">Image Descriptor</a></h2>
|
||||
|
||||
<p>From the sample file:
|
||||
|
||||
<span class="byte gif_imgdesc"> 2C </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 0A </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 0A </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
<span class="byte gif_imgdesc"> 00 </span>
|
||||
</p>
|
||||
|
||||
<p>A single GIF file may contain multiple images. In the original GIF
|
||||
rendering model these wwere meant to be composited onto a larger
|
||||
virtual canvas. Nowadays nultiple images are normally used for animations.</p>
|
||||
|
||||
<p>Each image begins with an image descriptor block. This block is
|
||||
exactly 10 bytes long.</p>
|
||||
|
||||
<p>The first byte is the <strong>image separator</strong>. Every image
|
||||
descriptor begins with the value <span class="byte">2C</span>. The
|
||||
next 8 bytes represent the location and size of the following
|
||||
image.</p>
|
||||
|
||||
<p>An image in the stream may not necessarily take up the entire
|
||||
canvas size defined by the logical screen descriptor. Therefore, the
|
||||
image descriptor specifies the <strong>image left position</strong>
|
||||
and <strong>image top position</strong> of where the image should
|
||||
begin on the canvas. Both these fields are usually ignored by modern
|
||||
viewers and browsers.</p>
|
||||
|
||||
<p>Next, this block specifies the <strong>image width</strong> and
|
||||
<strong>image height</strong>. Each of these values is in the
|
||||
two-byte, unsigned little-endian format. Our sample image indicates
|
||||
that the image starts at (0,0) and is 10 pixels wide by 10 pixels
|
||||
tall. (This image does take up the whole canvas size.)</p>
|
||||
|
||||
<p>The last byte is another packed field. In our sample file this byte is 0 so
|
||||
all of the sub-values will be zero. The first (most significant) bit in
|
||||
the byte is the <strong>local color table flag</strong>. Setting this flag
|
||||
to 1 allows you to specify that the image data that follows uses a different
|
||||
color table than the global color table. (More information on the local
|
||||
color table follows.)</p>
|
||||
|
||||
<p>The second bit is the <strong>interlace flag</strong>. Interlacing
|
||||
changes the way images are rendered onto the screen in a way that may
|
||||
reduce annoying visual flicker. The effect of interlacing on a display
|
||||
is that the first pass of appears immediately, displaying the graphic
|
||||
as a first as a blur and then sharpenining it up as later passes fill
|
||||
in lines. That allows the human viewer to at least get an idea of
|
||||
what's coming up rather than waiting for the entire image to be
|
||||
painted, line by line. <a
|
||||
href="http://webtutor.tamu.edu/lesson6/interlace.html">See an
|
||||
example</a>. To support this, the scan lines of the image need to be
|
||||
stored in a different order than the normal top-down, separated into
|
||||
sections that will be rendered in four separate passes.</p>
|
||||
|
||||
<p style="text-align:center"><img src="image_descriptor_block.gif"
|
||||
alt="GIF image descriptor block layout" style="border: 1px solid
|
||||
black" /></p>
|
||||
|
||||
<h2><a name="local_color_table_block">Local Color Table</a></h2>
|
||||
<p>A local color table is organized the same as a global color table. The local
|
||||
color table would always immediately follow an image descriptor but will only
|
||||
be there if the local color table flag is set to 1. It is effective only for the
|
||||
block of image data that immediately follows it. If no local color table
|
||||
is specified, the global color table is used for the following image data.</p>
|
||||
|
||||
<p>The size of the local color table can be calculated by the value
|
||||
given in the image descriptor. Just like with the global color table,
|
||||
if the image descriptor specifies a size of N, the color table will
|
||||
contain 2^(N+1) colors and will take up 3*2^(N+1) bytes.</p>
|
||||
|
||||
<h2><a name="image_data_block">Image Data</a></h2>
|
||||
|
||||
<p>From the sample file:
|
||||
<span class="byte gif_imgdata"> 02 </span>
|
||||
<span class="byte gif_imgdata"> 16 </span>
|
||||
<span class="byte gif_imgdata"> 8C </span>
|
||||
<span class="byte gif_imgdata"> 2D </span>
|
||||
<span class="byte gif_imgdata"> 99 </span>
|
||||
<span class="byte gif_imgdata"> 87 </span>
|
||||
<span class="byte gif_imgdata"> 2A </span>
|
||||
<span class="byte gif_imgdata"> 1C </span>
|
||||
<span class="byte gif_imgdata"> DC </span>
|
||||
<span class="byte gif_imgdata"> 33 </span>
|
||||
<span class="byte gif_imgdata"> A0 </span>
|
||||
<span class="byte gif_imgdata"> 02 </span>
|
||||
<span class="byte gif_imgdata"> 75 </span>
|
||||
<span class="byte gif_imgdata"> EC </span>
|
||||
<span class="byte gif_imgdata"> 95 </span>
|
||||
<span class="byte gif_imgdata"> FA </span>
|
||||
<span class="byte gif_imgdata"> A8 </span>
|
||||
<span class="byte gif_imgdata"> DE </span>
|
||||
<span class="byte gif_imgdata"> 60 </span>
|
||||
<span class="byte gif_imgdata"> 8C </span>
|
||||
<span class="byte gif_imgdata"> 04 </span>
|
||||
<span class="byte gif_imgdata"> 91 </span>
|
||||
<span class="byte gif_imgdata"> 4C </span>
|
||||
<span class="byte gif_imgdata"> 01 </span>
|
||||
<span class="byte gif_imgdata"> 00 </span></p>
|
||||
|
||||
<p>Finally we get to the actual image data. The image data is composed of
|
||||
a series of output codes which tell the decoder which colors to emit
|
||||
to the canvas. These codes are combined into the bytes that make up
|
||||
the block.</p>
|
||||
|
||||
<p>There's another section on decoding these output code into an image
|
||||
(see <a href="lzw_image_data.html">LZW Image Data</a>). Here we'll
|
||||
just see how to determine how long the block will be. </p>
|
||||
|
||||
<p>The first byte of this block is the <strong>LZW minimum code
|
||||
size</strong>. This value is used to decode the compressed output
|
||||
codes. (Again, see the section on <a href="lzw_image_data.html">LZW
|
||||
compression</a> to see how this works.) The rest of the bytes
|
||||
represent <em>data sub-blocks</em>. Data sub-blocks are are groups of
|
||||
1 - 256 bytes. The first byte in the sub-block tells you how many
|
||||
bytes of actual data follow. This can be a value from 0 (<span
|
||||
class="byte">00</span>) it 255 (<span class="byte">FF</span>). After
|
||||
you've read those bytes, the next byte you read will tell you now many
|
||||
more bytes of data follow that one. You continue to read until you
|
||||
reach a sub-block that says that zero bytes follow.
|
||||
</p>
|
||||
|
||||
<p>You can see our sample file has a LZW minimum code size of 2. The
|
||||
next byte tells us that 22 bytes of data follow it (<span
|
||||
class="byte">16</span> hex = 22). After we've read those 22 bytes, we
|
||||
see the next value is 0. This means that no bytes follow and we have
|
||||
read all the data in this block.</p>
|
||||
|
||||
<p style="text-align:center"><img src="image_data_block.gif" alt="GIF image data block layout" style="border: 1px solid black" /></p>
|
||||
|
||||
<h2><a name="plain_text_extension_block">Plain Text Extension</a></h2>
|
||||
<p>Example (not in the sample file):
|
||||
|
||||
<span class="byte gif_ext"> 21 </span>
|
||||
<span class="byte gif_ext"> 01 </span>
|
||||
<span class="byte gif_ext"> 0C </span>
|
||||
<span class="byte gif_ext"> 00 </span>
|
||||
<span class="byte gif_ext"> 00 </span>
|
||||
<span class="byte gif_ext"> 00 </span>
|
||||
<span class="byte gif_ext"> 00 </span>
|
||||
<span class="byte gif_ext"> 64 </span>
|
||||
<span class="byte gif_ext"> 00 </span>
|
||||
<span class="byte gif_ext"> 64 </span>
|
||||
<span class="byte gif_ext"> 00 </span>
|
||||
<span class="byte gif_ext"> 14 </span>
|
||||
<span class="byte gif_ext"> 14 </span>
|
||||
<span class="byte gif_ext"> 01 </span>
|
||||
<span class="byte gif_ext"> 00 </span>
|
||||
<span class="byte gif_ext"> 0B </span>
|
||||
<span class="byte gif_ext"> 68 </span>
|
||||
<span class="byte gif_ext"> 65 </span>
|
||||
<span class="byte gif_ext"> 6C </span>
|
||||
<span class="byte gif_ext"> 6C </span>
|
||||
<span class="byte gif_ext"> 6F </span>
|
||||
<span class="byte gif_ext"> 20 </span>
|
||||
<span class="byte gif_ext"> 77 </span>
|
||||
<span class="byte gif_ext"> 6F </span>
|
||||
<span class="byte gif_ext"> 72 </span>
|
||||
<span class="byte gif_ext"> 6C </span>
|
||||
<span class="byte gif_ext"> 64 </span>
|
||||
<span class="byte gif_ext"> 00 </span></p>
|
||||
|
||||
<p>The GIF89 specification allows you to specify text captions to be
|
||||
overlayed on the following image. This feature never took off;
|
||||
browsers and image-processing applications such as Photoshop ignore
|
||||
it, and GIFLIB doesn't try to interpret it.</p>
|
||||
|
||||
<p>The block begins with an <strong>extension introducer</strong> as all
|
||||
extension block types do. This value is always <span class="byte">21</span>.
|
||||
The next byte is the <strong>plain text label</strong>. This value of
|
||||
<span class="byte">01</span> is used to distinguish plain text extensions
|
||||
from all other extensions. The next byte is the <strong>block size</strong>.
|
||||
This tells you how many bytes there are until the actual text data begins, or
|
||||
in other words, how many bytes you can now skip. The byte value will probably be
|
||||
<span class="byte">0C</span> which means you should jump forward 12 bytes. The
|
||||
text that follows is encoded in data sub-blocks
|
||||
(see <a href="#image_data_block">Image Data</a> to see how
|
||||
these sub-blocks are formed). The block ends when you reach a sub-block of
|
||||
length 0.</p>
|
||||
|
||||
<h2><a name="application_extension_block">Application Extension</a></h2>
|
||||
<p>Example (not in sample file):
|
||||
<span class="byte gif_ext"> 21 </span>
|
||||
<span class="byte gif_ext"> FF </span>
|
||||
<span class="byte gif_ext"> 0B </span>
|
||||
<span class="byte gif_ext"> 4E </span>
|
||||
<span class="byte gif_ext"> 45 </span>
|
||||
<span class="byte gif_ext"> 54 </span>
|
||||
<span class="byte gif_ext"> 53 </span>
|
||||
<span class="byte gif_ext"> 43 </span>
|
||||
<span class="byte gif_ext"> 41 </span>
|
||||
<span class="byte gif_ext"> 50 </span>
|
||||
<span class="byte gif_ext"> 45 </span>
|
||||
<span class="byte gif_ext"> 32 </span>
|
||||
<span class="byte gif_ext"> 2E </span>
|
||||
<span class="byte gif_ext"> 30 </span>
|
||||
<span class="byte gif_ext"> 03 </span>
|
||||
<span class="byte gif_ext"> 01 </span>
|
||||
<span class="byte gif_ext"> 05 </span>
|
||||
<span class="byte gif_ext"> 00 </span>
|
||||
<span class="byte gif_ext"> 00 </span>
|
||||
</p>
|
||||
|
||||
<p>The GIF89 specification allows for application-specific information
|
||||
to be embedded in the GIF file itself. This capability is not much
|
||||
used. About the only known public one is the Netscape 2.0</a>
|
||||
extension (described below) which is used to loop an animated GIF
|
||||
file. We'll go into more detail on looping in when we talk about <a
|
||||
href="animation_and_transparency.html">animation</a>.</p>
|
||||
|
||||
<p>The Netscape 2.0 looping block must appear immediately after the
|
||||
global color table of the logical screen descriptor. It is
|
||||
19 bytes long.
|
||||
|
||||
<pre>
|
||||
byte 1 : 33 (hex 0x21) GIF Extension code
|
||||
byte 2 : 255 (hex 0xFF) Application Extension Label
|
||||
byte 3 : 11 (hex 0x0B) Length of Application Block
|
||||
(eleven bytes of data to follow)
|
||||
bytes 4 to 11 : "NETSCAPE"
|
||||
bytes 12 to 14 : "2.0"
|
||||
byte 15 : 3 (hex 0x03) Length of Data Sub-Block
|
||||
(three bytes of data to follow)
|
||||
byte 16 : 1 (hex 0x01)
|
||||
bytes 17 to 18 : 0 to 65535, an unsigned integer in
|
||||
little-endian byte format. This specifies the
|
||||
number of times the loop should
|
||||
be executed.
|
||||
byte 19 : 0 (hex 0x00) a Data Sub-Block Terminator.
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
<p>As with all extensions, we start with <span class="byte">21</span>
|
||||
which is the <strong>extension introducer</strong>. Next is the
|
||||
<strong>extension label</strong> which for application extensions is
|
||||
<span class="byte">FF</span>. The next value is the <strong>block
|
||||
size</strong> which tells you how many bytes there are before the
|
||||
actual application data begins. This byte value should be <span
|
||||
class="byte">0B</span> which indicates 11 bytes. These 11 bytes hold
|
||||
two pieces of information. First is the <strong>application
|
||||
identifier</strong> which takes up the first 8 bytes. These bytes
|
||||
should contain ASCII character codes that identify to which
|
||||
application the extension belongs. In the case of the example above,
|
||||
the application identifier is "NETSCAPE" which is
|
||||
conveniently 8 characters long. The next three bytes are the
|
||||
<strong>application authentication code</strong>. The spec says these
|
||||
bytes can be used to "authenticate the application
|
||||
identifier." With the Netscape 2.0 extension, this value is simply
|
||||
a version number, "2.0", hence the extensions name. What
|
||||
follows is the application data broken into data sub-blocks. As with
|
||||
the other extensions, the block terminates when you read a sub-block
|
||||
that has zero bytes of data.</p>
|
||||
|
||||
<h2><a name="comment_extension_block">Comment Extension</a></h2>
|
||||
|
||||
<p>Example (not in sample file):
|
||||
<span class="byte gif_ext"> 21 </span>
|
||||
<span class="byte gif_ext"> FE </span>
|
||||
<span class="byte gif_ext"> 09 </span>
|
||||
<span class="byte gif_ext"> 62 </span>
|
||||
<span class="byte gif_ext"> 6C </span>
|
||||
<span class="byte gif_ext"> 75 </span>
|
||||
<span class="byte gif_ext"> 65 </span>
|
||||
<span class="byte gif_ext"> 62 </span>
|
||||
<span class="byte gif_ext"> 65 </span>
|
||||
<span class="byte gif_ext"> 72 </span>
|
||||
<span class="byte gif_ext"> 72 </span>
|
||||
<span class="byte gif_ext"> 79 </span>
|
||||
<span class="byte gif_ext"> 00 </span></p>
|
||||
|
||||
<p>One last GIF89 extension type is the comment extension. This allows you
|
||||
to embed ASCII text in a GIF file, and is sometimes used to include an
|
||||
image description, image credit, or other human-readable metadata such as
|
||||
the GPS location of the image capture.</p>
|
||||
|
||||
<p>It's probably no surprise by now that the first byte is the
|
||||
<strong>extension introducer</strong> which is <span
|
||||
class="byte">21</span>. The next byte is always <span
|
||||
class="byte">FE</span> which is the <strong>comment label</strong>.
|
||||
Then we jump right to data sub-blocks containing ASCII character codes
|
||||
for your comment. As you can see from the example we have one data
|
||||
sub-block that is 9 bytes long. If you translate the character codes
|
||||
you see that the comment is "blueberry." The final byte,
|
||||
<span class="byte">00</span>, indicates a sub-block with zero bytes
|
||||
that follow which let's us know we have reached the end of the block.</p>
|
||||
|
||||
<p style="text-align:center"><img src="comment_ext.gif" alt="GIF comment extension block layout" style="border: 1px solid black" /></p>
|
||||
|
||||
<h2><a name="trailer_block">Trailer</a></h2>
|
||||
|
||||
<p>From sample file: <span class="byte gif_trailer"> 3B </span></p>
|
||||
|
||||
<p>The trailer block indicates when you've reached the end of the file.
|
||||
It is always a byte with a value of <span class="byte">3B</span>.</p>
|
||||
|
||||
<p style="text-align:center"><img src="trailer_block.gif" alt="GIF
|
||||
trailer block layout" style="border: 1px solid black" /></p>
|
||||
|
||||
<h2>Next: LZW Image Data</h2>
|
||||
|
||||
<p>Now that you know what the basic parts of a GIF file are, let's next
|
||||
focus our attention on how the actual image data is stored and compressed.<p>
|
||||
|
||||
<p><a href="lzw_image_data.html">Continue...</a></p>
|
||||
</div>
|
||||
|
||||
<div style="text-align:center; margin-top: 10px; padding-top: 10px; border-top: #cecece 1px solid">
|
||||
<a href="../index.html">Back to GIFLIB documentation</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 464 B |
|
After Width: | Height: | Size: 531 B |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>What's In A GIF</title>
|
||||
</head>
|
||||
<body>
|
||||
<table width='100%' cellpadding='0' summary='Canned page header' bgcolor="#ddd">
|
||||
<tr>
|
||||
<td><h2>What's In A GIF</h2></td>
|
||||
<td align="center"><img src="../giflib-logo.gif"></td>
|
||||
<td align="right">(main page)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="body">
|
||||
|
||||
<p>These pages explain down
|
||||
to the bit level what's inside a GIF, and are offered in the hope they
|
||||
will be useful to programmers using GIFLIB.</p>
|
||||
|
||||
<p>The explanation is in three parts:<p>
|
||||
|
||||
<ol>
|
||||
<li><a href="bits_and_bytes.html">Bits and Bytes</a> - first we look at the
|
||||
file format that makes up a GIF file</li>
|
||||
<li><a href="lzw_image_data.html">LZW Image Data</a> - a closer
|
||||
look at how image data is compressed within a GIF file</li>
|
||||
<li><a href="animation_and_transparency.html">Transparency and Animation</a> -
|
||||
how some of the more advanced features of GIF files work</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<p>Due credit: much of this material was written by one Mike
|
||||
Flickinger in 2005, though it has been significantly revised and
|
||||
expanded for GIFLIB. The illustrations are all his.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="text-align:center; margin-top: 10px; padding-top: 10px; border-top: #cecece 1px solid">
|
||||
<a href="../index.html">Back to GIFLIB documentation</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,81 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>What's In A GIF - LZW Image Data</title>
|
||||
<script type="text/javascript"></script>
|
||||
<link rel="stylesheet" href="../proj.css" />
|
||||
<style type="text/css">
|
||||
#code_table {margin: auto; margin-right:auto; border: 1px solid black}
|
||||
#code_table td {text-align: right;}
|
||||
#code_table td, #code_table th {text-align: right; border: 1px solid black;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width='100%' cellpadding='0' summary='Canned page header' bgcolor="#ddd">
|
||||
<tr>
|
||||
<td><h2>What's In A GIF</h2></td>
|
||||
<td align="center"><img src="../giflib-logo.gif"></td>
|
||||
<td align="right">(full code table)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="body">
|
||||
<div style="text-align:center; margin-top: 10px; padding-top: 10px; border-top: #cecece 1px solid">
|
||||
<p><a href="index.html">Back to the What's In A GIF index page.</a></p>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Here's the complete code table that is generated by the sample image.
|
||||
</p>
|
||||
<table id="code_table" cellspacing="0">
|
||||
<tr><th>Code</th> <th>Color Index(es)</th></tr>
|
||||
<tr><td>#0</td> <td>0</td> </tr>
|
||||
<tr><td>#1</td> <td>1</td> </tr>
|
||||
<tr><td>#2</td> <td>2</td> </tr>
|
||||
<tr><td>#3</td> <td>3</td> </tr>
|
||||
<tr><td>#4</td> <td>clear code</td> </tr>
|
||||
<tr><td>#5</td> <td>end of information code</td> </tr>
|
||||
<tr><td>#6</td> <td>1, 1</td> </tr>
|
||||
<tr><td>#7</td> <td>1, 1, 1</td> </tr>
|
||||
<tr><td>#8</td> <td>1, 1, 2</td> </tr>
|
||||
<tr><td>#9</td> <td>2, 2</td> </tr>
|
||||
<tr><td>#10</td> <td>2, 2, 2</td> </tr>
|
||||
<tr><td>#11</td> <td>2, 2, 1</td> </tr>
|
||||
<tr><td>#12</td> <td>1, 1, 1, 1</td> </tr>
|
||||
<tr><td>#13</td> <td>1, 1, 2, 2</td> </tr>
|
||||
<tr><td>#14</td> <td>2, 2, 2, 2</td> </tr>
|
||||
<tr><td>#15</td> <td>2, 1</td> </tr>
|
||||
<tr><td>#16</td> <td>1, 1, 1, 1, 1</td> </tr>
|
||||
<tr><td>#17</td> <td>1, 2</td> </tr>
|
||||
<tr><td>#18</td> <td>2, 2, 2, 2, 2</td> </tr>
|
||||
<tr><td>#19</td> <td>2, 1, 1</td> </tr>
|
||||
<tr><td>#20</td> <td>1, 1, 0</td> </tr>
|
||||
<tr><td>#21</td> <td>0, 0</td> </tr>
|
||||
<tr><td>#22</td> <td>0, 0, 0</td> </tr>
|
||||
<tr><td>#23</td> <td>0 ,2</td> </tr>
|
||||
<tr><td>#24</td> <td>2, 2, 2, 1</td> </tr>
|
||||
<tr><td>#25</td> <td>1, 1, 1, 0</td> </tr>
|
||||
<tr><td>#26</td> <td>0, 0, 0, 0</td> </tr>
|
||||
<tr><td>#27</td> <td>0, 2, 2</td> </tr>
|
||||
<tr><td>#28</td> <td>2, 2, 2, 2, 2, 0</td> </tr>
|
||||
<tr><td>#29</td> <td>0, 0, 0, 0, 1</td> </tr>
|
||||
<tr><td>#30</td> <td>1, 1, 1, 2</td> </tr>
|
||||
<tr><td>#31</td> <td>2, 2, 2, 0</td> </tr>
|
||||
<tr><td>#32</td> <td>0, 0, 0, 0, 1, 1</td> </tr>
|
||||
<tr><td>#33</td> <td>1, 1, 2, 2, 2</td> </tr>
|
||||
<tr><td>#34</td> <td>2, 2, 2, 1, 1</td> </tr>
|
||||
<tr><td>#35</td> <td>1, 1, 1, 1, 2</td> </tr>
|
||||
<tr><td>#36</td> <td>2, 2, 2, 2, 2, 1</td> </tr>
|
||||
<tr><td>#37</td> <td>1, 1, 1, 1, 1, 2</td> </tr>
|
||||
<tr><td>#38</td> <td>2, 2, 2, 2, 2, 1, 1</td> </tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="text-align:center; margin-top: 10px; padding-top: 10px; border-top: #cecece 1px solid">
|
||||
<a href="../index.html">Back to GIFLIB documentation</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 926 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 108 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 222 B |
|
After Width: | Height: | Size: 393 B |
|
After Width: | Height: | Size: 225 B |
|
After Width: | Height: | Size: 950 B |