PICCAT.BAS August 1998 by Marc Kummel aka Treebeard. Contact mkummel@rain.org, http://www.rain.org/~mkummel/ What is PICCAT? ---------------- PICCAT is a small program I wrote to solve a problem. I bought an Olympus 320L digital camera this summer to take photos of local plants for my flora website at . I love it! But after a month and a half, I've filled two zip disks with over 1000 images and 2 MB of files. The problem is to find anything. PICCAT is an image catalog and index program that solves this problem. Working With Digital Images: ----------------------------- Here's how I work with digital image files on my ancient Win31 computer system. Maybe not the best system, but it works with limited computer resources. First, I download the images with the Olympus software into a directory on my harddrive. They are saved with unhelpful names like pic00001.jpg, pic00002.jpg, etc. Then I fire up good ol' Paint Shop Pro v3.11 and start the PSP Browser to make thumbnails of all the images. Second, I start a new CATALOG.TXT file, using the blank NEWDATA.TXT that is included. Each day's shoot will go into it's own directory of my ZIP drive which is configured as drive e: on my system. Directory names are built from the date as eg \01AUG98 for pictures downloaded on 1 Aug 1998. Disk: e:\digcam1 Directory: 19jul98 Date: 19 July 1998 Location: West Camino Cielo, late afternoon Community: Chaparral, woodland Comments: There's an old homestead here Third, I open the image files one at a time by clicking on the thumbnails to open the image in PSP. My rule is to leave original image files as they are, except to rotate vertical pictures. I add a line about each image in the CATALOG.TXT file. For example: pic00001.jpg apocynum cannabinum, indian hemp, nice detail of leaves pic00002.jpg place, old homestead pic00003.jpg eriodictyon traskiae, white yerba santa, detail of flowers (etc.) Each catalog line starts with the picture file name, then spaces/tabs, then a KEY field (usually a botanical name for my project, but can be anything), then the rest of the description. It's ok to have multiple headers (date, etc) in the catalog file. When I'm done with all images, I save all files, including the CATALOG.TXT and the PSP thumbnail file, to the zip drive directory. When the zip drive is full, I also make a Thumbs Plus thumbnail file of the whole drive, and save it on the zip disk. Now all files are saved and known readable, so I clear the original image directory. The last step is to make a master CATALOG.TXT file in the root directory of the Zip drive that contains all the catalog files from each directory. Just APPEND each file, or make it as you go. Here's where PICCAT comes in. PICCAT can index the whole drive by KEY fields and create a formatted INDEX.TXT file of the results that can be printed out. It can also search all descriptions for any text and automatically copy all matching image files to a temporary directory with unique file names. At that point, I can open that directory in PSP to see only pictures of eg Yerba Santa. This makes it easy to select and resize the best pictures for the Web, or to create directories of species for a new Zip disk. It also makes a CATALOG.TXT file for the collection with info on each picture. On the Web, I use a PERL Cgi script that can read these catalog files to automatically make pages of pictures. (I've included the script in this archive, but there's no help yet. Send email if you're really interested) Using PICCAT: -------------- PICCAT is a DOS command line program. Run it in DOS, or a DOS session in Windows. It recognizes a few settings on the command line. piccat [/options] search+text [common+name] /c copy matching files to current directory /t copy matching files to TEMP directory (from Environment settings) /dd look for catalog on drive D: (default is drive e:) /i make index file on source drive (no search) /k search only key field, otherwise search all text By default, PICCAT searches drive e: (my Zip drive), and writes only to the screen. Use the /d option to search another drive, eg "/df" will index drive F: Use /c or /t to actually copy image files to your harddrive. If /i is used, PICCAT will make an index file of all KEYs on the source drive. All /options must be run together with no spaces. The search+text must use "+" instead of spaces. > piccat /c/df/k apocynum+cannabinum This will find all picture files on drive F: with "apocynum cannabinum" in the key field and copy them to the current directory. Then start PSP and get to work. The [common+name] value is used only by my PERL script. Dont worry about it unless you want to use the PICLIST.PL script. The Files: ----------- I wrote this program to do a job. You'll have to study the source code for more help. I wrote PICCAT using MS Basic PDS v7.10. The code uses the DIR$ function, so it will not work with QBasic or QB, though it could easily be modified. PICCAT.EXE DOS executable PICCAT2.BAS BASIC source code NEWDATA.TXT Blank catalog file ready to be filled-in and renamed CATALOG.TXT Sample catalog file PICLIST5.PL PERL Cgi to make image pages on the Web (no help yet) README.TXT This file TBVAULT.TXT Treebeard's Basic Vault info Conditions: ------------ This program and source code are yours to use and modify as you will, but they are offered as freeware with no warranty whatsoever. Give me credit, but do not distribute any changes under my name, or attribute such changes to me in any way. You're on your own! If you find this program or code useful, then let me know what you do with it, as a courtesy to a fellow programmer who still hacks for fun and glory. Any suggestions or comments will be much appreciated. Send comments and fixes to: Marc Kummel aka Treebeard mkummel@rain.org http://www.rain.org/~mkummel/ http://www.treebeard.org/ For more interesting Basic software with source code, check out Treebeard's Basic Vault at