home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-03-24 | 55.6 KB | 1,544 lines |
- Newsgroups: comp.sources.misc
- From: jwbirdsa@picarefy.picarefy.com (James W. Birdsall)
- Subject: v36i078: chiaro - Image Utilities, Part08/18
- Message-ID: <1993Mar25.181145.20419@sparky.imd.sterling.com>
- X-Md4-Signature: 91f2cc2dddbfa9acd4fc0d4253e17425
- Date: Thu, 25 Mar 1993 18:11:45 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: jwbirdsa@picarefy.picarefy.com (James W. Birdsall)
- Posting-number: Volume 36, Issue 78
- Archive-name: chiaro/part08
- Environment: UNIX, Sun, DECstation, 3B1
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: src/BUGS src/colors.c src/gifcheck.man
- # Wrapped by kent@sparky on Thu Mar 25 11:20:04 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 8 (of 18)."'
- if test -f 'src/BUGS' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/BUGS'\"
- else
- echo shar: Extracting \"'src/BUGS'\" \(384 characters\)
- sed "s/^X//" >'src/BUGS' <<'END_OF_FILE'
- XCHILS
- X
- XGIFSTRIP
- X
- XGIFCHECK
- X 1.0 patchlevel 0:
- X
- X * On small-memory systems, gifcheck sometimes cannot allocate memory
- X for decompression buffers when processing a directory target. It works
- X fine if you use wildcards -- "foodir/*" instead of "foodir". Looks
- X like a weird memory fragmentation problems, since it usually gets
- X through a couple files OK before choking.
- END_OF_FILE
- if test 384 -ne `wc -c <'src/BUGS'`; then
- echo shar: \"'src/BUGS'\" unpacked with wrong size!
- fi
- # end of 'src/BUGS'
- fi
- if test -f 'src/colors.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/colors.c'\"
- else
- echo shar: Extracting \"'src/colors.c'\" \(13516 characters\)
- sed "s/^X//" >'src/colors.c' <<'END_OF_FILE'
- X/***************************************************************************
- X* COLORS.C *
- X* MODULE: - *
- X* OS: UNIX *
- X* *
- X* Copyright (c) 1993 James W. Birdsall. All Rights Reserved. *
- X* *
- X* The Graphics Interchange Format(c) is the Copyright property of *
- X* CompuServe Incorporated. GIF(sm) is a Service Mark property of *
- X* CompuServe Incorporated. *
- X* *
- X* GIF and "Graphic Interchange Format" are trademarks (tm) of *
- X* CompuServe, Inc., an H&R Block company. *
- X* *
- X* $Id: colors.c,v 1.2 1993/02/10 02:02:14 jwbirdsa Exp $
- X* *
- X***************************************************************************/
- X
- X#include "config.h"
- X
- X/*
- X** system includes <>
- X*/
- X
- X#include <stdio.h>
- X#ifndef NO_MALLOCHDR
- X#include <malloc.h>
- X#endif
- X
- X
- X/*
- X** custom includes ""
- X*/
- X
- X#include "depend.h"
- X
- X#include "formats.h"
- X#include "colors.h"
- X
- X
- X/*
- X** local #defines
- X*/
- X
- X#define MAXTABLES 10
- X
- X#define VALIDATE_HANDLE(h) if (((h) < 0) || ((h) >= MAXTABLES) || \
- X (((HASHHAN *) NULL) == hanlist[handle])) \
- X return -1;
- X
- X/*
- X** misc: copyright strings, version macros, etc.
- X*/
- X
- Xstatic char CONST rcsid[] = "$Id: colors.c,v 1.2 1993/02/10 02:02:14 jwbirdsa Exp $";
- X
- X
- X/*
- X** typedefs
- X*/
- X
- Xtypedef struct {
- X HASHIT *list[HASHSIZE];
- X long uniques;
- X long entries;
- X} HASHHAN;
- X
- X
- X/*
- X** global variables
- X*/
- X
- X/*
- X** static globals
- X*/
- X
- Xstatic HASHHAN *hanlist[MAXTABLES] = { NULL, NULL, NULL, NULL, NULL,
- X NULL, NULL, NULL, NULL, NULL };
- X
- X
- X/*
- X** function prototypes
- X*/
- X
- X/*
- X** functions
- X*/
- X
- X/***************************************************************************
- X* FUNCTION: COL_OPEN *
- X* *
- X* DESCRIPTION: *
- X* *
- X* Opens a color hash table and returns its handle. *
- X* *
- X* ENTRY: *
- X* *
- X* Void. *
- X* *
- X* EXIT: *
- X* *
- X* Returns handle on success, -1 on error. *
- X* *
- X* CONSTRAINTS/SIDE EFFECTS: *
- X* *
- X* No more than MAXTABLES handles can be open at once, subject to *
- X* memory availability. *
- X* *
- X***************************************************************************/
- Xint
- Xcol_open()
- X{
- X int hanind;
- X int loop;
- X
- X /* Any handles free? */
- X
- X for (hanind = 0; hanind < MAXTABLES; hanind++)
- X {
- X /* If free break out of loop. */
- X
- X if (((HASHHAN *) NULL) == hanlist[hanind])
- X {
- X break;
- X }
- X }
- X if (MAXTABLES == hanind)
- X {
- X /* No handles free, return error. */
- X
- X return -1;
- X }
- X
- X /* Try to allocate memory. */
- X
- X hanlist[hanind] = (HASHHAN *) calloc(1, sizeof(HASHHAN));
- X if (((HASHHAN *) NULL) == hanlist[hanind])
- X {
- X /* Can't allocate a handle structure. */
- X
- X return -1;
- X }
- X
- X /* Initialize handle structure. */
- X
- X for (loop = 0; loop < HASHSIZE; loop++)
- X {
- X hanlist[hanind]->list[loop] = (HASHIT *) NULL;
- X }
- X hanlist[hanind]->uniques = 0;
- X hanlist[hanind]->entries = 0;
- X
- X /* Return the allocated handle. */
- X
- X return hanind;
- X} /* end of col_open() */
- X
- X
- X/***************************************************************************
- X* FUNCTION: COL_ENTER *
- X* *
- X* DESCRIPTION: *
- X* *
- X* Enters a color in the color hash table referenced by handle. *
- X* *
- X* ENTRY: *
- X* *
- X* handle - handle of table in which to enter color *
- X* newcol - color to be entered in table *
- X* *
- X* EXIT: *
- X* *
- X* Returns 0 on success, -1 on error. *
- X* *
- X* CONSTRAINTS/SIDE EFFECTS: *
- X* *
- X***************************************************************************/
- Xint
- X#ifdef __STDC__
- Xcol_enter(int handle, RGB_TRIPLET *newcol)
- X#else
- Xcol_enter(handle, newcol)
- Xint handle;
- XRGB_TRIPLET *newcol;
- X#endif
- X{
- X int hashval;
- X HASHIT *searcher;
- X
- X VALIDATE_HANDLE(handle);
- X
- X /* Update entries value. */
- X
- X hanlist[handle]->entries++;
- X
- X /* Compute hash value. */
- X
- X hashval = (newcol->red + newcol->green + newcol->blue) % HASHSIZE;
- X
- X /* Search hash list. */
- X
- X for (searcher = hanlist[handle]->list[hashval]; searcher != (HASHIT *) NULL;
- X searcher = searcher->next)
- X {
- X /* If color matches, break out of loop. */
- X
- X if ((searcher->c.red == newcol->red) &&
- X (searcher->c.green == newcol->green) &&
- X (searcher->c.blue == newcol->blue))
- X {
- X break;
- X }
- X }
- X
- X /* Is new or old? */
- X
- X if (((HASHIT *) NULL) == searcher)
- X {
- X /* Got a new one. */
- X
- X hanlist[handle]->uniques++;
- X
- X /* Allocate a structure for it. */
- X
- X if ((searcher = (HASHIT *) calloc(1, sizeof(HASHIT))) ==
- X (HASHIT *) NULL)
- X {
- X return -1;
- X }
- X
- X /* Initialize the structure. */
- X
- X searcher->c.red = newcol->red;
- X searcher->c.green = newcol->green;
- X searcher->c.blue = newcol->blue;
- X searcher->instances = 1;
- X
- X /* Put structure in hash table. */
- X
- X searcher->next = hanlist[handle]->list[hashval];
- X hanlist[handle]->list[hashval] = searcher;
- X }
- X else
- X {
- X /* Already in table, update variables. */
- X
- X searcher->instances++;
- X }
- X
- X /* Return OK. */
- X
- X return 0;
- X} /* end of col_enter() */
- X
- X
- X/***************************************************************************
- X* FUNCTION: COL_GETSTAT *
- X* *
- X* DESCRIPTION: *
- X* *
- X* Returns statistics on the color hash table referenced by handle. *
- X* *
- X* ENTRY: *
- X* *
- X* handle - handle of table *
- X* uniques - pointer to long to return number of unique colors *
- X* entries - pointer to long to return total number of colors entered *
- X* in table *
- X* *
- X* EXIT: *
- X* *
- X* Returns 0 on success, -1 on error. *
- X* *
- X* CONSTRAINTS/SIDE EFFECTS: *
- X* *
- X***************************************************************************/
- Xint
- X#ifdef __STDC__
- Xcol_getstat(int handle, long *uniques, long *entries)
- X#else
- Xcol_getstat(handle, uniques, entries)
- Xint handle;
- Xlong *uniques;
- Xlong *entries;
- X#endif
- X{
- X VALIDATE_HANDLE(handle);
- X
- X *uniques = hanlist[handle]->uniques;
- X *entries = hanlist[handle]->entries;
- X
- X return 0;
- X} /* end of col_getstat() */
- X
- X
- X/***************************************************************************
- X* FUNCTION: COL_CLOSE *
- X* *
- X* DESCRIPTION: *
- X* *
- X* Closes a color hash table, releasing memory etc. If retlist is not *
- X* NULL, contents of table are returned as a linked list. *
- X* *
- X* ENTRY: *
- X* *
- X* handle - handle of table to be closed *
- X* retlist - pointer to pointer in which pointer to head of linked *
- X* list is returned. *
- X* *
- X* EXIT: *
- X* *
- X* Returns 0 on success, -1 on error. *
- X* *
- X* CONSTRAINTS/SIDE EFFECTS: *
- X* *
- X***************************************************************************/
- Xint
- X#ifdef __STDC__
- Xcol_close(int handle, HASHIT **retlist)
- X#else
- Xcol_close(handle, retlist)
- Xint handle;
- XHASHIT **retlist;
- X#endif
- X{
- X int loop;
- X HASHIT *searcher, *scout;
- X
- X VALIDATE_HANDLE(handle);
- X
- X /* Are we returning list or not? */
- X
- X if (((HASHIT **) NULL) == retlist)
- X {
- X /* Not, so just free stuff. */
- X
- X for (loop = 0; loop < HASHSIZE; loop++)
- X {
- X searcher = hanlist[handle]->list[loop];
- X while (searcher != (HASHIT *) NULL)
- X {
- X scout = searcher->next;
- X free(searcher);
- X searcher = scout;
- X }
- X }
- X free(hanlist[handle]);
- X
- X /* Reset table entry. */
- X
- X hanlist[handle] = (HASHHAN *) NULL;
- X }
- X else
- X {
- X /* Returning list, so weave multiple lists into one and return. */
- X
- X /* Are there any entries? */
- X
- X if (MKLONG(0) == hanlist[handle]->entries)
- X {
- X *retlist = (HASHIT *) NULL;
- X }
- X else
- X {
- X /* Find first non-null entry. */
- X
- X for (loop = 0; loop < HASHSIZE; loop++)
- X {
- X if (((HASHIT *) NULL) == hanlist[handle]->list[loop])
- X {
- X continue;
- X }
- X }
- X *retlist = hanlist[handle]->list[loop];
- X searcher = *retlist;
- X while (searcher->next != (HASHIT *) NULL)
- X {
- X searcher = searcher->next;
- X }
- X for (; loop < HASHSIZE; loop++)
- X {
- X if (((HASHIT *) NULL) == hanlist[handle]->list[loop])
- X {
- X continue;
- X }
- X searcher->next = hanlist[handle]->list[loop];
- X while (searcher->next != (HASHIT *) NULL)
- X {
- X searcher = searcher->next;
- X }
- X }
- X }
- X
- X /* Clean up rest. */
- X
- X free(hanlist[handle]);
- X hanlist[handle] = (HASHHAN *) NULL;
- X }
- X
- X /* Return OK. */
- X return 0;
- X} /* end of col_close() */
- X
- END_OF_FILE
- if test 13516 -ne `wc -c <'src/colors.c'`; then
- echo shar: \"'src/colors.c'\" unpacked with wrong size!
- fi
- # end of 'src/colors.c'
- fi
- if test -f 'src/gifcheck.man' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/gifcheck.man'\"
- else
- echo shar: Extracting \"'src/gifcheck.man'\" \(38943 characters\)
- sed "s/^X//" >'src/gifcheck.man' <<'END_OF_FILE'
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- XNAME
- X gifcheck - GIF file analysis and verification
- X
- XSYNOPSIS
- X gifcheck [ -v ][ -H ][ -c ][ -dn ][ -en ][ -b ][ -r ][ -- ][
- X -l ][ -f ][ -h ] target [ target... ]
- X
- XDESCRIPTION
- X Gifcheck performs complete analysis and verification of
- X GIF-format images and displays the information it finds. It
- X can also be used in shell scripts to determine whether GIF
- X files are valid, and if they need to be passed through the
- X gifstrip program to remove excess characters.
- X
- XTARGETS
- X A target is a filename or directory. Multiple targets may be
- X specified on the command line. If a target is a directory,
- X all files in that directory will be processed. If no targets
- X are specified on the command line, a usage message will be
- X printed.
- X
- XOPTIONS
- X Options may not be combined. In the case of the -dn and -en
- X options, there cannot be a space between the option and the
- X argument to the option.
- X
- X -v Output is in a more verbose format. No additional data
- X is displayed.
- X
- X -H Plain Text Extensions and Comment Extensions are
- X displayed in hex dump format instead of as text.
- X
- X -c All color tables in the file are dumped as decimal RGB
- X triplets of the form RRR/GGG/BBB.
- X
- X -dn Sets display warning level (see DIAGNOSTICS below for
- X an explanation of the types):
- X
- X -d0 display anomalies and violations
- X -d1 (default) display anomalies, violations,
- X and fascinatings
- X -d2 display all (anomalies, violations,
- X fascinatings, nitpicks)
- X
- X -en Set exit warning level, at which processing of an image
- X is stopped and gifcheck skips to the next image (see
- X DIAGNOSTICS below for an explanation of the types):
- X
- X -e0 skip on anomalies only
- X -e1 (default) skip on anomalies and violations
- X -e2 skip on anomalies, violations,
- X and fascinatings
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 1
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X -b Operate in batch mode. All output is suppressed. This
- X option should be first on the command line or other
- X options may generate output before this option is
- X found. When in batch mode, gifcheck adjusts its status
- X return to reflect the results of processing. The status
- X may be:
- X
- X 0 the file is GIF format and did not need
- X stripping
- X 1 file is not GIF format
- X 2 an unexpected EOF was encountered
- X (usually indicates a corrupt file)
- X 3 any other error
- X 4 file is GIF format and needs stripping
- X 5 file is GIF format and needs to be
- X stripped with the -m option
- X
- X Note that the status reflects the result of only the
- X last file processed. Therefore, in batch mode only one
- X file should be specified on the command line.
- X
- X -r Redirects error messages to stderr.
- X
- X -- Read targets from stdin. The list of targets must have
- X only one target per line. Targets which are directories
- X will be expanded as usual, but wildcards will not be
- X expanded. Targets on the command line will be ignored.
- X For use with the -f option of chils.
- X
- X -l Disables check for excess characters at the beginning
- X of the file. By default, gifcheck will search through a
- X file looking for the GIF signature if the file does not
- X begin with that signature. This option will disable
- X that search.
- X
- X -f Disables image decompression. This can be a slow pro-
- X cess for large files. However, an image cannot be com-
- X pletely verified if it is not decompressed, and some
- X information can only be obtained by decompressing the
- X image data.
- X
- X -p If gifcheck was compiled with the PROGRESS_IND option
- X enabled, it will by default print a progress indicator
- X when decompressing an image. This option turns off the
- X progress indicator. Note that this option is not valid
- X if gifcheck was not complied with the PROGRESS_IND
- X option enabled. Check the help (-h) to see if this
- X option is listed and hence valid.
- X
- X -h Prints a usage message. No files are processed and all
- X other options are ignored.
- X
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 2
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- XOUTPUT
- X Gifcheck recognizes eight different types of blocks within a
- X GIF file: file headers, images, and five types of extension
- X block: generic extensions, Graphic Control Extensions, Plain
- X Text Extensions, Comment Extensions, and Application Exten-
- X sions (the last four are found only in GIF89a-format files).
- X
- X Data from each type of block is output in a different for-
- X mat, which may change according to the settings of the out-
- X put format options. The various displays are explained
- X below.
- X
- X FILE HEADER
- X The default file header display, with no options, looks like
- X this:
- X
- X Processing junk2/devil.gif...
- X FILE junk2/devil.gif GIF87a 11209 bytes
- X logical screen: 640 x 480
- X 8 bits per color available on source
- X GLOBAL COLOR TABLE:
- X 6 bits (64 colors) bg index 0 (000/000/000)
- X 59 unique colors.
- X
- X The first line gives the filename, in case an error is
- X encountered immediately. The second line repeats the
- X filename and displays the format and filesize. The third
- X line gives the size, in pixels, of the logical screen on
- X which all images in the file will be displayed. The fourth
- X line displays how many bits per color (R,G,B) were available
- X on the machine on which the file was created. This value is
- X frequently set incorrectly and may generally be ignored.
- X
- X The global color table, if present, has a subsection to
- X itself. The sixth line indicates how large the global color
- X table is. It also displays the background color index and
- X the RGB value corresponding to that index. While the back-
- X ground color index is actually part of the file header
- X proper, it is meaningless unless a global color table is
- X present, so it is displayed in the global color table sec-
- X tion. If the file is a GIF89a-format image, this line also
- X indicates whether the global color table is sorted. Finally,
- X the seventh line indicates how many unique colors are
- X present in the global color table.
- X
- X If no global color table is present, a line stating this is
- X displayed instead.
- X
- X If the -v option is in effect, the file header display looks
- X like this:
- X
- X
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 3
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X Processing junk2/devil.gif...
- X FILE junk2/devil.gif is GIF version GIF87a:
- X file size (bytes): 11209
- X logical screen size (pixels, width x height): 640 x 480
- X 8 bits per color available on source
- X This file has a global color table.
- X GLOBAL COLOR TABLE:
- X 6 bits per index for a table size of 64
- X background index 0, RGB value 000/000/000
- X 59 unique colors.
- X
- X The data displayed is the same, but more explanatory text is
- X included.
- X
- X If the -c option is in effect, the file header display looks
- X like this:
- X
- X Processing junk2/devil.gif...
- X FILE junk2/devil.gif GIF87a 11209 bytes
- X logical screen: 640 x 480
- X 8 bits per color available on source
- X GLOBAL COLOR TABLE:
- X 6 bits (64 colors) bg index 0 (000/000/000)
- X 59 unique colors.
- X 000/000/000 255/197/197 255/156/156 255/189/189 255/131/131
- X 255/180/180 255/148/148 255/205/205 041/000/000 255/123/123
- X 255/172/172 255/074/074 082/000/000 255/057/057 255/090/090
- X 255/115/115 008/000/000 049/000/000 255/164/164 024/000/000
- X 131/000/000 255/049/049 074/000/000 255/082/082 123/000/000
- X 255/139/139 065/000/000 148/000/000 255/041/041 016/000/000
- X 255/016/016 230/024/024 255/032/032 115/000/000 164/000/000
- X 057/000/000 255/106/106 106/000/000 156/000/000 255/008/008
- X 032/000/000 255/065/065 139/000/000 180/000/000 255/024/024
- X 098/000/000 090/000/000 238/000/000 189/000/000 230/000/000
- X 213/000/000 172/000/000 205/000/000 197/000/000 246/000/000
- X 222/000/000 230/016/016 255/000/000 255/098/098 000/000/000
- X 000/000/000 000/000/000 000/000/000 000/000/000
- X
- X The standard or verbose display is followed by a listing, in
- X decimal, of the raw RGB values found in the global color
- X map.
- X
- X IMAGE
- X The default image display, with no options, looks like this:
- X
- X IMAGE 1:
- X size 640 x 480 corner 0, 0 sequentially
- X This image uses the global color table (no local color table).
- X IMAGE DATA FOR IMAGE 1:
- X code size 6 bits
- X Reached end of codes in block 42
- X totals: 7906 codes packed into 10948 bytes in 43 blocks
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 4
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X 307200 pixels extracted
- X code table cleared 2 times
- X compressed data is 4% of the size of uncompressed image
- X 59 colors referenced (59 unique)
- X
- X Each image in the file is numbered by gifcheck starting at 1
- X and has a section to itself. The first line gives the image
- X number. The second line indicates the size, in pixels, of
- X the image; the location, in pixels, of the upper left
- X corner, and how the image is stored ("sequentially" or
- X "interlaced").
- X
- X The third line indicates whether there is a local color
- X table, and whether the image uses the global or local color
- X table. If there is a local color table, the third line is
- X followed by a color table display similar to the one for
- X global color tables, including a dump of the raw RGB values
- X if the -c color dump option is in effect. Very few images
- X have local color tables.
- X
- X Image data is stored compressed, and the compressed data is
- X further broken up into blocks (which are numbered by
- X gifcheck starting at 0). The fifth line indicates the
- X minimum code size for the image. The sixth line indicates
- X the block in which the end-of-information (EOI) code was
- X encountered. The seventh line indicates the number of codes
- X extracted, the number of bytes which those codes occupied,
- X and how many blocks those bytes were divided into. The
- X eighth line indicates how many pixels were generated when
- X the codes were decompressed, and the ninth line indicates
- X how many times the table-clear code was encountered.
- X
- X The tenth line indicates the size of the compressed data as
- X a percentage of the size of the uncompressed image. The size
- X of the compressed data is the size of the data only, not
- X including block headers, image headers, or any other non-
- X image data, so the compression ratio is accurate. The size
- X of the uncompressed image is calculated by multiplying the
- X height and the width to get the total number of pixels in
- X the image, then multiplying by the number of bits required
- X to represent the global or local color table, depending on
- X which one is used by the image. Finally, the eleventh line
- X indicates how many colors were referenced by the image data,
- X and how many of the colors referenced are unique.
- X
- X If the -v option is in effect, the image display looks like
- X this:
- X
- X IMAGE 1:
- X image size (pixels, width x height): 640 x 480
- X image upper left corner (column, row): 0, 0
- X image is stored sequentially
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 5
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X This image uses the global color table (no local color table).
- X IMAGE DATA FOR IMAGE 1:
- X code size 6 bits
- X Reached end of codes in block 42
- X totals: 7906 codes packed into 10948 bytes in 43 blocks
- X 307200 pixels extracted
- X code table cleared 2 times
- X compressed data is 4% of the size of uncompressed image
- X 59 colors referenced (59 unique)
- X
- X The data displayed is the same, but more explanatory text is
- X included.
- X
- X If the -f option is in effect, the image display looks like
- X this:
- X
- X IMAGE 1:
- X size 640 x 480 corner 0, 0 sequentially
- X This image uses the global color table (no local color table).
- X IMAGE DATA FOR IMAGE 1:
- X code size 6 bits
- X totals: 10948 bytes in 43 blocks
- X compressed data is 4% of the size of uncompressed image
- X
- X Since the compressed image data is not decompressed under
- X this option, less information is available.
- X
- X GENERIC EXTENSIONS
- X If the format is GIF87a, or the format is GIF89a but the
- X type identifier is not one of the four dedicated types, the
- X "generic extension" format is used. It looks like this:
- X
- X GENERIC EXTENSION BLOCK 1:
- X extension block type 255
- X BLOCK 0 (11 bytes):
- X G 47 I 49 F 46 L 4C I 49 T 54 E 45 20
- X 20 20 20
- X BLOCK 1 (6 bytes):
- X 01 ) 29 p 70 0E 02 00
- X totals: 17 bytes of data in 2 blocks
- X
- X Generic extension blocks are numbered sequentially by
- X gifcheck starting at 1. The first line indicates that it is
- X a generic extension block and gives the sequence number. The
- X second line shows the type identifier value. The next lines
- X display the data in hex dump format (generic extensions are
- X always displayed in hex dump format, regardless of the set-
- X ting of the -H option). Each data block is numbered sequen-
- X tially by gifcheck starting at 0. A line giving the data
- X block number and the number of bytes in the block is shown.
- X Then the data bytes themselves are displayed, eight per
- X line. If the byte is a printable character, the character is
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 6
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X printed, followed by the hex value of the byte; otherwise a
- X space is printed, followed by the hex value. Finally, a
- X totals line is printed, indicating the total number of data
- X bytes and the total number of data blocks.
- X
- X The -v option has no effect on generic extension displays.
- X
- X GRAPHIC CONTROL EXTENSION
- X Graphic Control Extensions (GCEs) are one of the GIF89a
- X dedicated extension types. When encountered, they are
- X displayed like this:
- X
- X GRAPHIC CONTROL EXTENSION BLOCK 1:
- X Disposal method: 0 (none)
- X User input is not expected
- X Transparency enabled (index 3)
- X No delay time specified
- X
- X GCEs are numbered sequentially (by gifcheck). The first line
- X indicates that it is a GCE and gives the sequence number.
- X The second line shows the disposal method (which applies to
- X the next graphic -- i.e. image or Plain Text Extension -- in
- X the file). This can be: "none", "leave in place", "restore
- X to background", or "restore to previous".
- X
- X The third line indicates whether user input is expected
- X before the next graphic will be displayed. The fourth line
- X indicates whether a transparency color index (which indi-
- X cates that pixels of the given color should be rendered
- X "transparent" -- i.e., not drawn) has been specified, and if
- X so, what the transparency index is. The last line indicates
- X whether a delay time (delay before the next graphic is
- X displayed) has been specified, and if so what the delay
- X value is.
- X
- X The -v option has no effect on GCE displays.
- X
- X PLAIN TEXT EXTENSION
- X Plain Text Extensions (PTEs) are one of the GIF89a dedicated
- X extension types. When encountered, they are displayed like
- X this:
- X
- X PLAIN TEXT EXTENSION BLOCK 1:
- X char cell 8 x 28, grid 96( 12) x 28( 1) at 0, 112
- X Foreground color index 0 (RGB 016/016/014)
- X Background color index 3 (RGB 113/110/232)
- X START TEXT (12 characters):
- X Cass Berry
- X END TEXT.
- X
- X PTEs are numbered sequentially by gifcheck starting at 1.
- X The first line indicates that it is a PTE and gives the
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 7
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X sequence number. The second line shows: the size of the
- X character cell, in pixels; the size of the character grid,
- X in pixels and cells (cells in parentheses); and the location
- X of the upper left corner of the grid. The third line shows
- X the index and RGB values of the foreground text color, and
- X the fourth line shows the same for the background color.
- X
- X The fifth line indicates the start of the text, and how many
- X characters of text are present. It is followed by the text
- X itself, which is in turn followed by an "END TEXT." marker
- X on the next line.
- X
- X If the -v option is in effect, PTEs are displayed like this:
- X
- X PLAIN TEXT EXTENSION BLOCK 1:
- X Character cell grid upper left corner (column, row): 0, 112
- X Character cell size (pixels, width x height): 8 x 28
- X Character grid size (pixels, width x height): 96 x 28
- X Character grid size (chars, width x height): 12 x 1
- X Foreground color index 0 (RGB 016/016/014)
- X Background color index 3 (RGB 113/110/232)
- X START TEXT (12 characters):
- X Cass Berry
- X END TEXT.
- X
- X The same information is displayed, but more explanatory text
- X is included.
- X
- X If the -H option is in effect, the text is displayed in hex
- X dump format, like this:
- X
- X PLAIN TEXT EXTENSION BLOCK 1:
- X char cell 8 x 28, grid 96( 12) x 28( 1) at 0, 112
- X Foreground color index 0 (RGB 016/016/014)
- X Background color index 3 (RGB 113/110/232)
- X START TEXT (12 characters):
- X LINE 1:
- X 20 C 43 a 61 s 73 s 73 20 B 42 e 65
- X r 72 r 72 y 79 20
- X END TEXT.
- X
- X Instead of simply displaying the text, each character is
- X displayed individually, followed by its hex value.
- X
- X COMMENT EXTENSION
- X Comment Extensions are one of the GIF89a dedicated extension
- X types. When encountered, they are displayed like this:
- X
- X COMMENT EXTENSION BLOCK 1:
- X START TEXT (161 characters):
- X +-------------------------------------------------+
- X | Multi-image GIF89a created with CompuMake Tools |
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 8
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X +-------------------------------------------------+
- X
- X END TEXT.
- X 0 unprintable characters.
- X
- X Comment Extensions are numbered sequentially by gifcheck
- X starting at 1. The first line indicates that it is a Comment
- X Extension and gives the sequence number. The second line
- X indicates the start of the text and how many characters of
- X text are present. It is followed by the text itself, which
- X is in turn followed by an "END TEXT." marker on the next
- X line. The last line indicates how many unprintable charac-
- X ters were found in the text.
- X
- X The -v option has no effect on Comment Extension displays.
- X
- X If the -H option is in effect, the text is displayed in hex
- X dump format, like this:
- X
- X COMMENT EXTENSION BLOCK 1:
- X START TEXT (161 characters):
- X + 2B - 2D - 2D - 2D - 2D - 2D - 2D - 2D
- X - 2D - 2D - 2D - 2D - 2D - 2D - 2D - 2D
- X - 2D - 2D - 2D - 2D - 2D - 2D - 2D - 2D
- X - 2D - 2D - 2D - 2D - 2D - 2D - 2D - 2D
- X - 2D - 2D - 2D - 2D - 2D - 2D - 2D - 2D
- X - 2D - 2D - 2D - 2D - 2D - 2D - 2D - 2D
- X - 2D - 2D + 2B 0D 0A | 7C 20 M 4D
- X u 75 l 6C t 74 i 69 - 2D i 69 m 6D a 61
- X g 67 e 65 20 G 47 I 49 F 46 8 38 9 39
- X a 61 20 c 63 r 72 e 65 a 61 t 74 e 65
- X d 64 20 w 77 i 69 t 74 h 68 20 C 43
- X o 6F m 6D p 70 u 75 M 4D a 61 k 6B e 65
- X 20 T 54 o 6F o 6F l 6C s 73 20 | 7C
- X 0D 0A + 2B - 2D - 2D - 2D - 2D - 2D
- X - 2D - 2D - 2D - 2D - 2D - 2D - 2D - 2D
- X - 2D - 2D - 2D - 2D - 2D - 2D - 2D - 2D
- X - 2D - 2D - 2D - 2D - 2D - 2D - 2D - 2D
- X - 2D - 2D - 2D - 2D - 2D - 2D - 2D - 2D
- X - 2D - 2D - 2D - 2D - 2D - 2D - 2D - 2D
- X - 2D - 2D - 2D - 2D + 2B 0D 0A 0D
- X 0A
- X END TEXT.
- X 0 unprintable characters.
- X
- X Instead of simply displaying the text, each character is
- X displayed individually, followed by its hex value.
- X
- X APPLICATION EXTENSION
- X Application Extensions are one of the GIF89a dedicated
- X extension types. When encountered, they are displayed like
- X this:
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 9
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X APPLICATION EXTENSION BLOCK 1:
- X application identifier:
- X f 66 r 72 a 61 c 63 t 74 i 69 n 6E t 74
- X application authentication code:
- X 0 30 0 30 1 31
- X 246 bytes of application data.
- X F 46 r 72 a 61 c 63 t 74 a 61 l 6C 00
- X 96 00 07 00 00 00 00 h 68
- X D8 FB 0C @ 40 00 00 00 20
- X 0B FF 0C @ 40 00 00 00 00
- X 00 E9 I 49 ? 3F 00 00 00 00
- X F0 = 3D 89 ? 3F 00 00 00 00
- X 00 00 00 00 00 00 00 00
- X 00 00 00 00 00 00 00 00
- X 00 00 00 00 1B 00 80 02
- X E0 01 00 01 04 00 00 00
- X 00 00 00 00 00 00 00 00
- X 00 00 00 00 00 00 00 00
- X 00 00 00 00 00 00 FF FF
- X 01 00 01 00 00 00 00 00
- X 00 00 00 00 00 00 00 00
- X 00 00 00 00 E7 03 00 00
- X Z 5A 00 09 01 00 00 x 78 00
- X 8C 00 ( 28 00 00 00 02 00
- X n 6E 00 00 00 00 00 01 00
- X FF FF 01 00 00 00 14 00
- X 00 00 00 00 04 00 00 00
- X 00 00 04 00 P 50 00 d 64 00
- X 00 00 00 00 00 00 FF FF
- X 00 00 00 h 68 D8 FB 0C @ 40
- X 00 00 00 00 00 E9 I 49 ? 3F
- X g 67 00 04 00 06 01 00 00
- X 00 00 00 00 00 00 D8 A7
- X 00 00 00 06 02 03 00 00
- X 00 00 00 00 00 00 00 00
- X 00 00 00 00 00 00 00 00
- X 01 00 00 00 00 00
- X
- X Application Extensions are numbered sequentially by gifcheck
- X starting at 1. The first line indicates that it is an Appli-
- X cation Extension and gives the sequence number. The second
- X line introduces the eight-byte application identifier and is
- X followed on the third line by the application identifier
- X itself, in hex dump format. The fourth line introduces the
- X three-byte application authentication code and is followed
- X on the fifth line by the application authentication code
- X itself, in hex dump format. The sixth line indicates how
- X many bytes of application data are present, and is followed
- X by the application data itself in hex dump format. All data
- X in Application Extensions is always displayed in hex dump
- X format, regardless of the setting of the -H option.
- X
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 10
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X The -v option has no effect on Application Extension
- X displays.
- X
- X TERMINATOR
- X When the GIF terminator block is encountered, gifcheck
- X prints this line:
- X
- X GIF TERMINATOR
- X
- XDIAGNOSTICS
- X Gifcheck can produce a variety of diagnostic messages. Some
- X indicate problems within the GIF file. Others indicate mal-
- X functions of gifcheck or the computer. Messages beginning
- X with "ANOMALY", "VIOLATION", "FASCINATING", and "NITPICK"
- X indicate problems within the GIF file. Messages beginning
- X "FATAL ERROR", "ERROR", or "WARNING" indicate malfunctions.
- X Messages beginning "STRIP" indicate that the file should be
- X processed by the gifstrip program to remove excess charac-
- X ters.
- X
- X ANOMALIES
- X Anomalies are radical violations of the GIF specification.
- X Anomalies may be caused by massive corruption of the file,
- X to the extent that gifcheck cannot determine how to proceed
- X with processing of the file, or by individual values that
- X make no sense. In either case, an image with anomalies will
- X probably be rejected by most GIF viewers. Anomalies are
- X always displayed and always cause gifcheck to skip immedi-
- X ately to the next file to be processed.
- X
- X The various anomalies that gifcheck can detect are explained
- X below.
- X
- X ANOMALY: end of data reached before end of codes
- X gifcheck reached the end of the packed image data
- X without encountering an End-of-Information code, which
- X signals the end of the image.
- X
- X ANOMALY: decompression error in block xxx at offset yyy
- X gifcheck found a bad code in the packed image data.
- X This indicates that the file has been corrupted, and
- X most likely the rest of the file is trash.
- X
- X ANOMALY: foreground color index off end of global color
- X table
- X The color index specified for the foreground in a
- X GIF89a Plain Text Extension is invalid (PTEs always use
- X the global color table).
- X
- X ANOMALY: background color index off end of global color
- X table
- X
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 11
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X The color index specified for the background in a
- X GIF89a Plain Text Extension is invalid (PTEs always use
- X the global color table).
- X
- X ANOMALY: an undefined disposal method (x) is given
- X The value in the disposal method of a Graphic Control
- X Extension is undefined.
- X
- X ANOMALY: a ... cannot follow a ...
- X Where "..." is a block type. The GIF89a specification
- X includes a grammar which indicates which types of
- X blocks can follow which other types of blocks (in the
- X simpler GIF87a specification, there was no need). This
- X grammar has been violated.
- X
- X VIOLATIONS
- X Violations are major violations of the GIF specification.
- X Violations may be caused by corruption of the file or by
- X individual values that make no sense. In either case, an
- X image with violations may be rejected by some viewers and
- X displayed with difficulty by others. Violations are always
- X displayed, and by default cause gifcheck to skip immediately
- X to the next file to be processed.
- X
- X The various violations that gifcheck can detect are
- X explained below.
- X
- X VIOLATION: image does not fit on logical screen
- X Either the size of the image given in the image header
- X is greater in one or both dimensions than the size of
- X the logical screen given in the file header, or the
- X position of the image given in the image header causes
- X parts of the image to extend beyond the boundaries of
- X the logical screen.
- X
- X VIOLATION: bad transparency index (x)
- X If processing a Plain Text Extension, indicates that
- X the transparency index specified by a preceeding
- X Graphic Control Extension is off the end of the global
- X color table (PTEs always use the global color table).
- X If processing an image, indicates that the transparency
- X index is off the end of either the global or local
- X color table, depending on which one the image uses.
- X
- X VIOLATION: character grid does not fit on logical screen
- X Either the size of the character grid given in the
- X Plain Text Extension is greater in one or both dimen-
- X sions than the size of the logical screen given in the
- X file header, or the position of the character grid
- X causes parts of it to extend beyond the boundaries of
- X the logical screen.
- X
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 12
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X VIOLATION: text is too long to fit into character grid
- X The text given in the Plain Text Extension contains
- X more characters than there are character cells in the
- X character grid.
- X
- X VIOLATION: xxx garbage characters found between blocks
- X There should be no garbage characters between blocks.
- X While this can theoretically be solved by using the
- X gifstrip program, it probably indicates that the file
- X has been corrupted.
- X
- X FASCINATINGS
- X Fascinatings are not always violations of the GIF specifica-
- X tion. Fascinatings are unusual conditions which most
- X viewers can cope with, but are still worthy of note. Fas-
- X cinatings are displayed by default, and by default do NOT
- X cause gifcheck to skip.
- X
- X The various fascinatings that gifcheck can detect are
- X explained below.
- X
- X FASCINATING: this file does not contain a global color table
- X The GIF specification allows for files without global
- X color tables; they are to be displayed using the global
- X color table from a previous file, or a default table
- X chosen by the viewer if no previous global color table
- X is available. Files without global color tables are
- X extremely rare. This message is displayed when an image
- X which uses the global color table is encountered in a
- X file which has none.
- X
- X FASCINATING: xxx extra blocks on end of image
- X The packed image data continued for one or more blocks
- X after the block in which the End-of-Information (EOI)
- X code was found. While this condition is suspicious, the
- X data before the EOI decompressed correctly (otherwise
- X an ANOMALY would have occurred), so there's no concrete
- X evidence that the image is bad.
- X
- X FASCINATING: too few pixels extracted (xxx lines found, yyy
- X pixels missing)
- X When the End-of-Information code was encountered, too
- X few pixels had been extracted to fill the image (e.g,
- X for a 320 by 200 image, which should have 64,000 pix-
- X els, only 63,999 were extracted). Typically only one or
- X two are missing. Viewers seem to cope with this condi-
- X tion OK.
- X
- X FASCINATING: too many pixels extracted (xxx extra)
- X When the End-of-Information code was encountered, more
- X pixels than necessary had been extracted (e.g., for a
- X 320 by 200 image, which should have 64,000 pixels,
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 13
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X 64,001 were extracted). Typically only one or two
- X extras are present. Viewers seem to cope with this con-
- X dition OK.
- X
- X FASCINATING: code table never cleared
- X While this is technically OK, it is recommended prac-
- X tice to clear the decompression code table (via a clear
- X code in the compressed image data) immediately at the
- X beginning of the image. If the code table was never
- X cleared, this initial clear never occurred.
- X
- X FASCINATING: this file has no Global Color Table (GCT is
- X used by PTE)
- X The GIF specification allows for files without global
- X color tables; they are to be displayed using the global
- X color table from a previous file, or a default table
- X chosen by the viewer if no previous global color table
- X is available. Files without global color tables are
- X extremely rare. This message is displayed when a Plain
- X Text Extension (PTEs always use the global color table)
- X is encountered in a file which has no global color
- X table.
- X
- X FASCINATING: transparency index does not match either fore-
- X ground or background
- X This message is displayed when processing a Plain Text
- X Extension and the transparency index specified by a
- X preceeding Graphic Control Extension does not match
- X either the foreground or the background color indices
- X of the PTE. This renders the transparency index mean-
- X ingless, since it only applies to the next graphic
- X (image or PTE) following the GCE. Nothing is techni-
- X cally wrong, but it's weird.
- X
- X NITPICKS
- X Nitpicks are minor technical violations of the GIF specifi-
- X cation. Some are very common, and they should not cause
- X problems when viewing the file. Nitpicks are by default NOT
- X displayed, and never cause gifcheck to skip.
- X
- X The various nitpicks that gifcheck can detect are explained
- X below. Most of these messages are self-explanatory, so no
- X detailed explanation is given.
- X
- X NITPICK: byte 6 of the logical screen descriptor should be 0
- X for GIF87A
- X
- X NITPICK: bit 3, byte 4 of logical screen descriptor should
- X be 0 for GIF87A
- X
- X NITPICK: bits 3 and 4, byte 9 of image descriptor should be
- X 0
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 14
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- X NITPICK: bit 5, byte 9 of image descriptor should be 0 for
- X GIF87A
- X
- X NITPICK: bits 5-7, byte 1 of graphic control extension
- X should be 0
- X
- X NITPICK: local color table size is nonzero
- X The image does not have a local color table, but the
- X local color table size is nonzero.
- X
- X NITPICK: character grid not an integral number of character
- X cells wide
- X The horizontal size of the character grid in a Plain
- X Text Extension is not evenly divisible by the horizon-
- X tal size of a character cell.
- X
- X NITPICK: character grid not an integral number of character
- X cells high
- X The vertical size of the character grid in a Plain Text
- X Extension is not evenly divisible by the vertical size
- X of a character cell.
- X
- X NITPICK: xxx unprintable characters in text
- X Plain Text Extensions are supposed to contain only "7-
- X bit printable ASCII characters".
- X
- X MISCELLANEOUS
- X Gifcheck can also produce messages beginning with "FATAL
- X ERROR", "ERROR", "WARNING", and "STRIP". The first three
- X indicate malfunctions of gifcheck or the computer, and typi-
- X cally cause gifcheck to exit immediately. Messages beginning
- X with "STRIP" indicate that the file should be processed by
- X the gifstrip program to remove excess characters, and are
- X simply for the user's information. Processing of the file is
- X not affected.
- X
- XCOPYRIGHT
- X Gifcheck is copyright 1993 by James W. Birdsall, all rights
- X reserved.
- X
- X The Graphics Interchange Format(c) is the Copyright property
- X of CompuServe Incorporated. GIF(sm) is a Service Mark pro-
- X perty of CompuServe Incorporated.
- X
- XAUTHOR
- X James W. Birdsall
- X support@picarefy.com
- X uunet!uw-coco!amc-gw!picarefy!support
- X CompuServe: 71261,1731
- X GEnie: J.BIRDSALL2
- X
- X
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 15
- X
- X
- X
- X
- X
- X
- XGIFCHECK(1) USER COMMANDS GIFCHECK(1)
- X
- X
- X
- XSEE ALSO
- X chils(1), gifstrip(1)
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- XSun Release Last change: $Date: 1993/03/13 02:58:49 $ 16
- X
- X
- X
- END_OF_FILE
- if test 38943 -ne `wc -c <'src/gifcheck.man'`; then
- echo shar: \"'src/gifcheck.man'\" unpacked with wrong size!
- fi
- # end of 'src/gifcheck.man'
- fi
- echo shar: End of archive 8 \(of 18\).
- cp /dev/null ark8isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 18 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-