garden tote with tools
back link arrowPictools

Using Pictools

 two beers
by Zweibieren

Up ArrowPhyspics
Up ArrowAnnals of ZB

Pictools are my tools for managing physpics.com. Their focus is on building pages with lots of pictures (three thousand and counting).

Templates allow different projects to display thumbnail pictures in different designs. A Makefile system and directory structure provide a framework for organizing the build and deployment of pages. (They are built into a local structure and later uploaded quickly.) A set of commands are available, though mostly they are used through the Makefiles.


Using the tools to build a webpage

The following is a sketch of steps I might take to develop my next set of pictures pages, say for project 2007/Spring. In this case I will use gendirs and will generate files like those from Peru and Ecuador. It is gendirs that requires the two templates, template.tpl and frame.tpl. Genhtml uses the template pictd.tpl

1. Upload all pictures from camera to C:\pictures\Originals\2007\Spring. I treat Originals\... as Insert/Read-only; uploaded pictures are neither deleted nor edited. Instead I copy selected and edited versions to another directory. (Backslashes are for Windows file names. When giving commands through cygwin, I use forward slashes.)

2. Create directory C:\pictures\Digested\2007\Spring\ for the selected pictures.  With Picasa, visit C:\pictures\Originals\2007\Spring and select the useful pictures. Crop, recolor, adapt them. Export them to C:\pictures\Digested\2007\Spring. (When you edit with Picasa, it shows the results, but the pictures remain unchanged. The exported images DO reflect the edits. However, if you "save changes" with Picasa, the originals are moved to a subdirectory called "originals" and the picture is replaced with the processed picture.)

3. The webpage will be part of my PICSRC tree. So (with a Cygwin command window) create directory  $PICSRC/annals/2007/Spring/pix. This directory, .../pix/, will have only control and HTML files; the pictures will remain in Digested. From there they will be processed to make smaller versions in the staging area,

4. In a Cygqin window, change directory to c:/pictures/Digested/2007/Spring run gencaps:
gencaps $PICSRC/annals/2007/Spring/pic/captions.cap
This creates .../pix/captions.cap with each picture represented by one line with the picture's file name.

5. Edit .../pix/captions.cap to have captions following the file names. Rearrange lines to reorder the display sequence. Insert segment headers (file: ...) to break up the set of images into smaller segments. Delete caption lines for pictures no longer seeming worthy. (I'm not sufficiently ruthless when selecting pictures with Picasa.)

6. To turn .../pix/ into a webpage we need to add at least a Makefile, an index.hin file, and two template files: template.tpl and frame.tpl. I usually start by grabbing these files from some earlier project. You can start with copying and revising the ones distributed in pictools/.

7. Edit the index.hin file in .../pix/ to show off your pictures as you like. Somewhere in it put $include(captions-titles.txt). This will put in links to the index.html files for the individual segments of pictures.

8. Generate the site into the local staging area:
cd .../pix
make build
This creates in $PICSTAGE/annals/2007/Spring/pix/ a website that behaves much like the final released site.

9. Review the new pages by browsing to $PICSTAGE/annals/2007/Spring/pix/index.html. Note the changes you want to make and edit the files in .../pix/. If it is not yet midnight, return to step 7.

10. If you selected pictures with Picasa and then omited them from captions.cap, you can make another cpations page just listing those almost-good-enough pages. Go to .../pix/ and say
make newpix
This command generates newpix.cap.  Rename it immediately, say call it recentpix.cap. Change the segment name after file: in its first line. I usually do not put captions in recentpix.cap. To incorporate this new set of captions, add to index.hin a line
$include(recentpix-titles.txt)
and add to Makefile the line
$(DEST)/index.html: recentpix-titles.txt
Return to step 7.

11. When you are happy with the web pages in the staging area, upload them to the server:
cd .../pix/
make upload
Be sure to review the actual website and check every link.

I use the following in my work:
Google
Of course.
Picasa
For managing the photograph collection. I have one directory with all the original photos. Those photos selected for viewing are exported to another directory.
PowerPoint
(Windows) For creating images with drawing tools and clipart.
"Prt Scr"
(Windows) Keyboard key. Type it to save screen to clipboard.
Paint
(Windows) Paste the clipboard and crop to the image. Save in .bmp or .png format to avoid .jpg's propensity to smear cues and .gif's penchant for changing colors.
Excel
(Windows) Great for structured calculation. Also great for generating code.
Wordpad
(Windows) Great little editor. Does nothing unexpected. It is the only tool for me when writing a first draft. Far superior to notepad and MS Weird.
Windows Explorer
Really the only way to get at your files. But grep is better for finding strings in files.
Composer
The Mozilla web page editor. Obsolete. Use Nvu, instead, but even it cannot match commercial products.
Cygwin
Unix preceded Windows and will outlast it. For good reason. I use tcsh, bash, gcc, grep, sed, gawk, ed, dos2unix ...
ImageMagick
(Cygwin) All sorts of image manipulation. Conversion from various formats to .png format. The user interface and documentation has been upgraded from impossible to highly annoying. Thyssen's tutorials are essential reading.
GNU make
(Cygwin) Manages the build and upload of the site.
OpenSSH
(Cygwin) Automated upload tool.
Emacs
(Cygwin) The do-all editor. Nothing like it for keyboard macros and query-replace of newlines and tabs. The Windows based version loads as quickly as wordpad. User interface not quite as good as wordpad for the simple stuff.
formati11
The only tool I've found that creates Windows .ico files. (ImageMagick claims to, but didn't.)
Mozilla
Excellent web browser. Obsolete; use FireFox and Kompozer.
Copyright boilerplate for zweibieren
Copyright 2008, Zweibieren
8 Aug 2008  11:38 PM
Page maintained by Zweibieren  two steins of beer