home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / INSTALL / GIFMAN / GIFMAN.DOC < prev    next >
Text File  |  1992-11-29  |  9KB  |  315 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                 GIFMAN v1.0
  8.  
  9.                                      
  10.                                      
  11.                                      
  12.                                      by
  13.  
  14.                                 Tod Daniels
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. What is GIFMAN?
  28. ---------------
  29.  
  30. GIFMAN is a GIF file managing program.  Over the past few years, my GIF 
  31. collection has grown from a few that could be stored on floppies to several
  32. hundred taking up a nice chunk of my hard drive.  The problem then was, I
  33. had many GIFs that were duplicates or different scans of the same image.
  34. So, I sat down and began writing GIFMAN.  One weekend of hectic programming
  35. to develop a usable version, a month or so of hands-on/hands-off programming,
  36. and another weekend of hectic programming to smooth out the rough edges and
  37. voila!!  GIFMAN was born.  Now I had a way to keep track of my GIFs by 
  38. entering descriptions into a catalogue holding other important info, such as
  39. file size, date, and image size and colors.  It proved to be so useful to me
  40. that I decided to share it with the rest of the world.  
  41.  
  42. GIFMAN
  43.   - provides image and file information on all catalogued GIFs
  44.   - allows for image viewing using your favorite GIF viewer
  45.   - provides detailed text descriptions of every file in the catalogue
  46.   - allows catalogues to be upgraded with new additions to your GIF
  47.     collection
  48.   - provides an on-disk catalogue of your GIF floppies
  49.  
  50. Well, enough of the sales pitch.  On to the program.  By the way, if 
  51. something like GIFMAN or something better already exists, let me know.
  52. Maybe I'll use it instead and save myself more programming time.
  53.  
  54.  
  55.  
  56. Using GIFMAN
  57. ------------
  58.  
  59. 1) Command line parameters
  60.  
  61. USAGE:  GIFMAN [drive:][path] [/?]
  62.  
  63.         [drive:][path]   specifies drive and path to GIF files and catalogue.
  64.         [/?]             displays the help screen.
  65.  
  66. GIFMAN will look for GIF files and create a catalogue file called GIFMAN.CAT
  67. in the directory specified on the command line.  If no directory is given,
  68. GIFMAN will use the current working directory.
  69.  
  70. 2) GIFMAN Screen
  71.  
  72. The GIFMAN screen displays 10 entries from the catalogue.  Any currently 
  73. marked selections are shown with a '√' before the entry.  The number in the
  74. lower rights shows the total number of GIFs found.  The current directory 
  75. is shown just below the number of GIFs.
  76.  
  77. 3) Keyboard functions
  78.  
  79. Cursor keys
  80.  
  81.   Move highlighted entry up or down.
  82.  
  83. <PGUP>
  84.   
  85.   Moves catalogue window up one page.
  86.  
  87. <PGDWN>
  88.  
  89.   Moves catalogue window down one page.
  90.  
  91. <HOME>
  92.  
  93.   Moves to first entry in catalogue.
  94.  
  95. <END>
  96.  
  97.   Moves to last entry in catalogue.
  98.  
  99. E -- Edit entry
  100.   
  101.   The current entry description is cleared and the user is prompted to enter 
  102.   a new description.
  103.  
  104. W -- Write changes
  105.   
  106.   The current catalogue is written to disk.  If a catalogue existed, it is
  107.   backed up to GIFMAN.TMP (once, further writes will not change this file)
  108.   before the new catalogue is written.  Also features a handy autosave
  109.   function (see Other Features, below).
  110.  
  111.  
  112.  
  113. B -- Build catalogue
  114.  
  115.   Create a new GIFMAN.CAT catalogue from the current working directory.  User
  116.   is prompted to include current catalogue entries.  This saves having to 
  117.   re-enter descriptions when new GIF files are added to the catalogue.
  118.  
  119. P -- Print
  120.  
  121.   Prints contents of current catalogue to PRN.  Nothing fancy, yet.
  122.  
  123. <ESC> -- Exit
  124.  
  125.   Exits GIFMAN.  If changes to current catalogue have not been saved, user
  126.   is prompted.
  127.  
  128. <SPACE> -- Select
  129.  
  130.   Selects a file for later viewing.  Selections are marked with a '√'.
  131.  
  132. <ENTER> -- View
  133.  
  134.   Views all currently selected entries.  If none are selected, views 
  135.   highlighted entry.
  136.  
  137. 4) GIFMANV.BAT
  138.  
  139. I have not yet written a viewing program for GIFMAN, that is scheduled for 
  140. a later release.  In the meantime, it is fairly difficult to manage your GIFs
  141. without being able to view them, so GIFMAN will spawn a batch process to do 
  142. this.  The file GIFMANV.BAT, located somewhere in the current directory, or 
  143. accessible through the path, will spawn the process to view the GIFs.  For
  144. demonstration purposes, I've included a small GIF-viewing program and 
  145. modified the GIFMANV.BAT file.
  146.  
  147.   EXAMPLES for some popular GIF viewers:
  148.  
  149.     VUIMG
  150.     -----
  151.     @echo off
  152.     d:\graphics\vuimg -vd:\graphics\dnvga -m14 -s5 -bn -t2000 -d%1
  153.  
  154.     VPIC
  155.     ----
  156.     @echo off
  157.     c:\utils\vpic %1 /a
  158.  
  159.     GIF
  160.     ---
  161.     @echo off
  162.     c:\gif %1
  163.  
  164. The GIF filename will be passed as the first parameter (%1).
  165.  
  166.  
  167.  
  168. 5) Other Features
  169.  
  170. GIFMAN features a handy autosave function.  After every 10 modifications to 
  171. the catalogue, GIFMAN will prompt you to save the catalogue.  It only took a
  172. single instance of entering several descriptions and a program lock-up for
  173. me to include this time-saver.
  174.  
  175. GIFMAN also reads the entire catalogue into memory.  One complaint I had with
  176. some other viewers was that they had to reaccess the disk for every page of
  177. images.  The only limitation here is the amount of memory in your machine.
  178. For the most part, GIFMAN uses far pointers, so there should be sufficient 
  179. conventional memory for most viewers.
  180.  
  181.  
  182.  
  183. Catalogue building routine
  184. --------------------------
  185.  
  186. Without a doubt, the catalogue-building routine is the slowest part of the
  187. program.  For small directories, it works well enough, but in a directory
  188. of more than 100 entries, expect to spend several minutes waiting for the
  189. new catalogue to be constructed.  
  190. For programmers, I've included a partial listing of the catalogue routine.
  191. It uses the findfirst() and findnext() functions to get directory entries.
  192. If you can think of a better way to do this, let me know.  This program was 
  193. compiled with Borland C++, so I will need to use compatible functions.
  194.  
  195.  
  196. void build_cat()
  197. {
  198.   int done, status;
  199.   char *ptr, *ff_ext, *type;
  200.   int day, month, year;
  201.   int hour, minute, meridian;
  202.   char filepath[MAXPATH];
  203.   char getfile[MAXPATH];
  204.  
  205.   FILE *tempfile;
  206.           
  207.   if ((tempfile = fopen(tmpnam(temp), "wt")) == NULL)
  208.   {
  209.     disp_noopen();
  210.     fcloseall();
  211.     return;
  212.   }
  213.  
  214.   strcpy(filepath, gifpath);
  215.   strcat(filepath, "*.GIF");
  216.   done = findfirst(filepath,&ffblk,0);
  217.   while (!done)
  218.   {
  219.     fnmerge(getfile, drive, path, ffblk.ff_name, NULL);
  220.     status = getinfo(getfile);  
  221.  
  222.     /* some decoding of file and date-time structures goes here */
  223.  
  224.     fprintf(tempfile, "%-8s %3s  ", ffblk.ff_name, ff_ext);
  225.     if (status)
  226.       fprintf(tempfile, "ERROR in GIF file    ");
  227.     else
  228.       fprintf(tempfile, "%3s %4dx%3dx%-3d %c%c  ", 
  229.         type, width, height, colors, globl, interlace);
  230.     fprintf(tempfile, 
  231.       "%7li  %02d-%02d-%02d  ", ffblk.ff_fsize, month, day, year);
  232.     fprintf(tempfile, "%2d:%02d%c\n", hour, minute, meridian);
  233.     done = findnext(&ffblk);
  234.   }
  235.   fclose(tempfile);
  236. }
  237.  
  238.  
  239.  
  240. int getinfo(char *filename)
  241. {
  242.  
  243.   if ((giffile = fopen(filename, "rb")) == NULL)
  244.     return(-1);
  245.  
  246.   handle = fileno(giffile); 
  247.  
  248.   if ((gifver[0] = getbyte(giffile)) == 'G')
  249.   {
  250.     for (index = 1; index < 6; index++)
  251.       gifver[index] = getbyte(giffile);
  252.     gifver[6] = '\000';
  253.   }
  254.   else
  255.   {
  256.     fclose(giffile);
  257.     return(-1);
  258.   }
  259.  
  260.   /* read gif info, such as size, version, colors, interlace, etc) */
  261.  
  262.   fclose(giffile);
  263.   return(0);
  264. }
  265.  
  266.  
  267.  
  268. Future releases
  269. ---------------
  270.  
  271. Future releases of GIFMAN should include a (of course) built-in viewer, and
  272. management of multiple GIF directories from a single catalogue.  If I come up
  273. with a development kit, a Windows version should be forthcoming as well.
  274.  
  275.  
  276.  
  277.  
  278. Drop me a line
  279. --------------
  280.  
  281. If you find this a useful program, or if you discover any errors,
  282. please write
  283.  
  284.   Tod Daniels
  285.   6 Allandale Dr F20
  286.   Newark, DE 19713
  287.  
  288. I'm interested in seeing just how far this program goes.  And, once I have
  289. you on my mailing list, I'll notify you of releases of further versions.  I
  290. spent a few days programming this, and I'm giving it away for free.  The 
  291. least you could do is let me know it is being used.  I didn't spend too much
  292. time debugging, either, so let me know of any errors.
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299. Legal Notices
  300. -------------
  301.  
  302. This program is offered as Freeware, subject to the following conditions:
  303.  
  304.   This program may not be modified without consent of author,
  305.   program may not be distributed as part of a larger program or package,
  306.   author retains all rights to the intellectual property within this
  307.   program, and any other rights expressed or implied by the title Freeware.
  308.  
  309. The author will not be held liable for any damages resulting from the use 
  310. of this program.
  311.  
  312. GIF and Graphic Interchange Format are trademarks (tm) of Compuserve, Inc.
  313. and H&R Block company.
  314.  
  315.