

			=========================

			     ShowGIF V2.1

			=========================


			     Feb. 10, 1995


		Copyright (c) 1994/95 by Roman Hiestand





Copyright notice
----------------

The program ShowGIF and its documentation  are written and copyrighted by
Roman Hiestand. They may be distributed freely providing the following
restrictions are satisfied:

- Distributors may not charge more than the cost of a diskette used in
  the distribution of this program.

- Distributors may only distribute the unmodified copy of the original
  program, along with it's documentation, and copyright notices intact.

- Commercial  distribution  is  only  possible with written permission
  from the author.


Disclaimer
----------

This program and its documentation is provided "as is". No warranties are made
with respect to the accuracy, reliability, performance or operation of this
software and information. You are using this program at your own risk. The
author is not liable for any damages that may have been caused by using this
software.



Description
-----------

ShowGIF is, as the name says, a GIF viewer for the Picasso-II graphics board
of VillageTronic.
The program can be started from CLI or Workbench with one or more file
names/icons. If the program cannot load an image (because you didn't submit
a filename or the file doesn't exist), a file requester pops up.


Usage
-----

From CLI: ShowGIF Image [...]

 Template: FILES/M,BUF/N,DELAY/N,NOCENTER/S,VERBOSE/S,ALL/S

 FILES/M: One or more filenames to be viewed
          If no filenames are given or the files weren't GIFs, a
	  file-requester pops up.
 BUF/N:   Specify the FileBufferSize in KB, like BUF 100
 DELAY/N: Specifies the delay in seconds after showing the
	  picture. If none is given, the program waits for
	  a key or a mousebutton.
	  Remember: during this delay, the program can't be
	  stopped !
 NOCENTER:Normally, a picture is centered on the screen. If you
	  don't want this behaviour, set NOCENTER.
 VERBOSE: Display name and resolution of the image and the screen.
 ALL:	  Search all subdirectories for the specified pattern.
	  (see also Pattern matching below)

 Examples:

 ShowGIF BUF=5 SYS:Images/Globe.gif

 ShowGIF DF0:Pictures/Mercedes.gif DF0:Pictures/Family.GIF BUF 10 DELAY 5

From Workbench:
 - Default Tool: Specify ShowGIF as the default tool of an image
 - Multiple selection: With the shift-key pressed, select an image and
   double-click on ShowGIF's icon.

 The arguments DELAY, NOCENTER and VERBOSE can also be accessed from WB
 via ToolTypes.


Features
--------

- fully programmed in assembler
- uses a file buffer (50 KB by default)
- CLI or WB start
- very system-friendly
- (nearly) pure
- can be aborted at anytime (except during a crash ... :-) )
  (with Ctrl-C, since V2.1 also with Escape)
- no 'light' background (since V1.1)
- file requester (since V1.2)
- FileBufSize can be specified (since V1.3)
- supports entire GIF87a standard (local color maps, interlaced images,
	multiple images, since V1.5)
- supports partly GIF89a standard (comment/plain text extension)
- Parameters via WB/ToolTypes (since V1.8)
- Pattern matching (since V2.0)
- NoDrop feature (since V2.1, see below)

About being 'nearly' pure:
You can safely make this program resident. You can run ShowGIF as many times
as you want, if you run one *after* the other. A problem *can* arise when you
run two or more ShowGIF's at the same time. The only part that is not pure is
where it opens the screen and the window. This time is quite short, and it is
very unlikely to happen that two ShowGIF's interfere. By the way, have you
ever tried to view two images at the very same time ? (Not very useful, ay ?)


The NoDrop feature
------------------
ShowGIF tries to open a screen above the previous one. This avoids 
'flickering' by switching back to the Workbench resolution. Your monitor 
will be thankful...
If the memory is low and a second screen can't be opened, the first one
is closed first and the screen is opened again.


Pattern Matching
----------------
(NB: * only works if you use WildStar or a similar program. Use #?
instead)

Since V2.0 pattern matching is implemented. As this is a complex matter
and it's not really the same in every program, I describe it in this
chapter.
ShowGIF splits your supplied pattern into two parts:

	ShowGIF		DF0:Pictures/*.gif
			| Path      || pattern \

 - The easy case: the path is not a pattern
   ShowGIF just searches the pattern in the supplied path and displays
   every picture found.
   Example: ShowGIF DF0:Pictures/*.gif
	displays every picture in DF0:Pictures with .gif at the end.
	    ShowGIF DF0:Pictures/A*
	displays every picture in DF0:Pictures starting with A or a.

   If you add 'ALL', the supplied path is taken as a starting point.
   Every subdirectory is now searched for the pattern.
   Example: ShowGIF DF0:*.gif ALL
	displays every picture in DF0: and its subdirectories with
	.gif at the end.

 - The complex case: the path is a pattern
   ShowGIF searches now every path that matches the path pattern for
   the file pattern.
   The same with 'ALL', but now every subdirectory is searched too.
   Example: ShowGIF DH0:G*/A*.gif
	displays every picture in DH0:Graphics, DH0:Games ...
	that matches A*.gif (A at the beginning and .gif at the end)
	    ShowGIF DH0:G*/A*.gif
	displays every picture in all subdirectories of DH0:Graphics,
	DH0:Games ... that matches A*.gif

Of course, every standard pattern matching characters can be used:
  ?  Matches any single character
  #  Matches zero or more of the following character
  |  Separates OR clauses
  *  Matches any number of arbitrary characters (only with WildStar)

Examples:
 - *.gif matches Mercedes.gif, Family.gif ...
 - #a.gif matches .gif, a.gif, aa.gif, aaa.gif ...
 - A* matches Ape.gif, a.gif, Amiga.gif (but also: Amiga.gif.info !)
 - a(b|c).gif matches ab.gif and ac.gif

Pattern matching is NOT case sensitive.


Requirements
------------

Kick 2.0 and vilintuisup.library version > 2.0.


Bugs
----

- VERBOSE may display data in wrong order with multiple images

The problem is: I haven't got any GIFs with local colors, multiple images
or plain text extensions. So I couldn't test it. I think, it works, but
I'm not sure.
If you find a bug, please report it to me together with as much information
as possible that could help me to fix it: your computer, configuration, kick
version and so on.


Future plans
------------

- view images larger than the largest screen available
- reduce colors
(NB: don't expect anything in the near future !)


Notes about this program
------------------------

The Graphics Interchange Format(c) is the Copyright property of CompuServe
Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated.
This program has been fully written in assembler. It is therefore very short
and quite fast. The GIF decoding algorithm is mainly based on the c-source
(jrdgif.c) of the jpeg software (version 4 of the jpeg software release),
which itself is based on giftoppm. Many thanks to the JPEG group ! (Even if
their real goal is to provide the JPEG-standard, not software for GIF :-) )

ShowGIF is pretty much optimised. Not only by the assembler (PhxAss is GREAT!
Thanks to F. Wille), but also by hand. At this time, I can't think of another
optimisation.
When I compared ShowGIF to VT, I was pretty surprised because I didn't expect
VT being so fast. Maybe I overlooked a couple of optimisations ...



Comparison table
----------------
(Not representative)


		   ShowGIF V2.0	  ViewGIF 1.6   VT_Picasso V2.1  ReadGIF V1.249
			       from VillageTronic		    (J.Weinelt)
		   ------------------------------------------------------------

Executable size		3848	       19376	     84584		 12276
display time (~,secs)	  11		  33	        15		    24
Mem needed (~)	     1.12 MB	     1.18 MB	   2.41 MB	       1.17 MB


Time & mem are measured with 'globe.gif' (547365 bytes, 912x900), a beautiful
picture of the Venus from NASA. Program & image are on harddisk. The memory is
measured including display memory (~1.03 MB).

These are just typical values. The differences in speed become smaller with
smaller images and larger if the image is on ram-disk.



Revisions
---------

	1.0	-	first public release

	1.1	-	added support for interlaced images
			now fills background with darkest color

	1.2	-	file requester added

	1.3	-	now checks for Ctrl-C (requested by Markus Illenseer)
			corrected a bug in GetCode
			added CLI-option BUF

	1.4	-	Multiple images supported
			Output window for workbench
			Faster ~10 %

	1.5	-	Doesn't quit anymore if GIF-revision is >89a
			Supports Local color table
			Correctly processes (skips) GIF89a extension blocks
			CLI-option DELAY
			some small optimisations

	1.6	-	Now supports some GIF89a extensions
			even faster !

	1.7	-	Slightly faster (~10%) and shorter

	1.8	-	Added Center-behaviour, NOCENTER option
			VERBOSE option
			added ToolTypes parsing

	2.0	-	Pattern matching (this is worth skipping 1.9 :-)

	2.1	-	Added NoDrop behaviour (requested a long time ago by
			Christian A. Weber and Henning Sauer)
			Escape now quits the program like Ctrl-C


Address
-------

I can be reached at

Roman Hiestand
Luziaweg 15
CH-8807 Freienbach
Switzerland

Fax: CH-055/48 26 37

email: rhiestan@iiic.ethz.ch
