home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
- GIFMAN v1.0
-
-
-
-
- by
-
- Tod Daniels
-
-
-
-
-
-
-
-
-
-
-
-
- What is GIFMAN?
- ---------------
-
- GIFMAN is a GIF file managing program. Over the past few years, my GIF
- collection has grown from a few that could be stored on floppies to several
- hundred taking up a nice chunk of my hard drive. The problem then was, I
- had many GIFs that were duplicates or different scans of the same image.
- So, I sat down and began writing GIFMAN. One weekend of hectic programming
- to develop a usable version, a month or so of hands-on/hands-off programming,
- and another weekend of hectic programming to smooth out the rough edges and
- voila!! GIFMAN was born. Now I had a way to keep track of my GIFs by
- entering descriptions into a catalogue holding other important info, such as
- file size, date, and image size and colors. It proved to be so useful to me
- that I decided to share it with the rest of the world.
-
- GIFMAN
- - provides image and file information on all catalogued GIFs
- - allows for image viewing using your favorite GIF viewer
- - provides detailed text descriptions of every file in the catalogue
- - allows catalogues to be upgraded with new additions to your GIF
- collection
- - provides an on-disk catalogue of your GIF floppies
-
- Well, enough of the sales pitch. On to the program. By the way, if
- something like GIFMAN or something better already exists, let me know.
- Maybe I'll use it instead and save myself more programming time.
-
-
-
- Using GIFMAN
- ------------
-
- 1) Command line parameters
-
- USAGE: GIFMAN [drive:][path] [/?]
-
- [drive:][path] specifies drive and path to GIF files and catalogue.
- [/?] displays the help screen.
-
- GIFMAN will look for GIF files and create a catalogue file called GIFMAN.CAT
- in the directory specified on the command line. If no directory is given,
- GIFMAN will use the current working directory.
-
- 2) GIFMAN Screen
-
- The GIFMAN screen displays 10 entries from the catalogue. Any currently
- marked selections are shown with a '√' before the entry. The number in the
- lower rights shows the total number of GIFs found. The current directory
- is shown just below the number of GIFs.
-
- 3) Keyboard functions
-
- Cursor keys
-
- Move highlighted entry up or down.
-
- <PGUP>
-
- Moves catalogue window up one page.
-
- <PGDWN>
-
- Moves catalogue window down one page.
-
- <HOME>
-
- Moves to first entry in catalogue.
-
- <END>
-
- Moves to last entry in catalogue.
-
- E -- Edit entry
-
- The current entry description is cleared and the user is prompted to enter
- a new description.
-
- W -- Write changes
-
- The current catalogue is written to disk. If a catalogue existed, it is
- backed up to GIFMAN.TMP (once, further writes will not change this file)
- before the new catalogue is written. Also features a handy autosave
- function (see Other Features, below).
-
-
-
- B -- Build catalogue
-
- Create a new GIFMAN.CAT catalogue from the current working directory. User
- is prompted to include current catalogue entries. This saves having to
- re-enter descriptions when new GIF files are added to the catalogue.
-
- P -- Print
-
- Prints contents of current catalogue to PRN. Nothing fancy, yet.
-
- <ESC> -- Exit
-
- Exits GIFMAN. If changes to current catalogue have not been saved, user
- is prompted.
-
- <SPACE> -- Select
-
- Selects a file for later viewing. Selections are marked with a '√'.
-
- <ENTER> -- View
-
- Views all currently selected entries. If none are selected, views
- highlighted entry.
-
- 4) GIFMANV.BAT
-
- I have not yet written a viewing program for GIFMAN, that is scheduled for
- a later release. In the meantime, it is fairly difficult to manage your GIFs
- without being able to view them, so GIFMAN will spawn a batch process to do
- this. The file GIFMANV.BAT, located somewhere in the current directory, or
- accessible through the path, will spawn the process to view the GIFs. For
- demonstration purposes, I've included a small GIF-viewing program and
- modified the GIFMANV.BAT file.
-
- EXAMPLES for some popular GIF viewers:
-
- VUIMG
- -----
- @echo off
- d:\graphics\vuimg -vd:\graphics\dnvga -m14 -s5 -bn -t2000 -d%1
-
- VPIC
- ----
- @echo off
- c:\utils\vpic %1 /a
-
- GIF
- ---
- @echo off
- c:\gif %1
-
- The GIF filename will be passed as the first parameter (%1).
-
-
-
- 5) Other Features
-
- GIFMAN features a handy autosave function. After every 10 modifications to
- the catalogue, GIFMAN will prompt you to save the catalogue. It only took a
- single instance of entering several descriptions and a program lock-up for
- me to include this time-saver.
-
- GIFMAN also reads the entire catalogue into memory. One complaint I had with
- some other viewers was that they had to reaccess the disk for every page of
- images. The only limitation here is the amount of memory in your machine.
- For the most part, GIFMAN uses far pointers, so there should be sufficient
- conventional memory for most viewers.
-
-
-
- Catalogue building routine
- --------------------------
-
- Without a doubt, the catalogue-building routine is the slowest part of the
- program. For small directories, it works well enough, but in a directory
- of more than 100 entries, expect to spend several minutes waiting for the
- new catalogue to be constructed.
- For programmers, I've included a partial listing of the catalogue routine.
- It uses the findfirst() and findnext() functions to get directory entries.
- If you can think of a better way to do this, let me know. This program was
- compiled with Borland C++, so I will need to use compatible functions.
-
-
- void build_cat()
- {
- int done, status;
- char *ptr, *ff_ext, *type;
- int day, month, year;
- int hour, minute, meridian;
- char filepath[MAXPATH];
- char getfile[MAXPATH];
-
- FILE *tempfile;
-
- if ((tempfile = fopen(tmpnam(temp), "wt")) == NULL)
- {
- disp_noopen();
- fcloseall();
- return;
- }
-
- strcpy(filepath, gifpath);
- strcat(filepath, "*.GIF");
- done = findfirst(filepath,&ffblk,0);
- while (!done)
- {
- fnmerge(getfile, drive, path, ffblk.ff_name, NULL);
- status = getinfo(getfile);
-
- /* some decoding of file and date-time structures goes here */
-
- fprintf(tempfile, "%-8s %3s ", ffblk.ff_name, ff_ext);
- if (status)
- fprintf(tempfile, "ERROR in GIF file ");
- else
- fprintf(tempfile, "%3s %4dx%3dx%-3d %c%c ",
- type, width, height, colors, globl, interlace);
- fprintf(tempfile,
- "%7li %02d-%02d-%02d ", ffblk.ff_fsize, month, day, year);
- fprintf(tempfile, "%2d:%02d%c\n", hour, minute, meridian);
- done = findnext(&ffblk);
- }
- fclose(tempfile);
- }
-
-
-
- int getinfo(char *filename)
- {
-
- if ((giffile = fopen(filename, "rb")) == NULL)
- return(-1);
-
- handle = fileno(giffile);
-
- if ((gifver[0] = getbyte(giffile)) == 'G')
- {
- for (index = 1; index < 6; index++)
- gifver[index] = getbyte(giffile);
- gifver[6] = '\000';
- }
- else
- {
- fclose(giffile);
- return(-1);
- }
-
- /* read gif info, such as size, version, colors, interlace, etc) */
-
- fclose(giffile);
- return(0);
- }
-
-
-
- Future releases
- ---------------
-
- Future releases of GIFMAN should include a (of course) built-in viewer, and
- management of multiple GIF directories from a single catalogue. If I come up
- with a development kit, a Windows version should be forthcoming as well.
-
-
-
-
- Drop me a line
- --------------
-
- If you find this a useful program, or if you discover any errors,
- please write
-
- Tod Daniels
- 6 Allandale Dr F20
- Newark, DE 19713
-
- I'm interested in seeing just how far this program goes. And, once I have
- you on my mailing list, I'll notify you of releases of further versions. I
- spent a few days programming this, and I'm giving it away for free. The
- least you could do is let me know it is being used. I didn't spend too much
- time debugging, either, so let me know of any errors.
-
-
-
-
-
-
- Legal Notices
- -------------
-
- This program is offered as Freeware, subject to the following conditions:
-
- This program may not be modified without consent of author,
- program may not be distributed as part of a larger program or package,
- author retains all rights to the intellectual property within this
- program, and any other rights expressed or implied by the title Freeware.
-
- The author will not be held liable for any damages resulting from the use
- of this program.
-
- GIF and Graphic Interchange Format are trademarks (tm) of Compuserve, Inc.
- and H&R Block company.
-
-