|
|
|
This page is years out of date. The last significant update was in July 2012. Things have changed, and they will continue to change. If you like what you see, please contact me by email and we can discuss your needs.
This page attempts to describe how I process and present my photos. Unlike most photographers, I don't use standard tools or web sites like Flickr or Picasa. Instead, I process things almost entirely my own way. Why? I think it gives me more flexibility. This is a first draft at describing what I do.
In the following document I frequently refer to specific URLs in a link. The link doesn't always go where the name suggests: the name is where things normally end up, and the link is where I've put the examples for this document (in /grog/photography/processing/).
My files are available here. I only update them on request, so if you want them, let me know.
I have a directory /Photos/Tools with most of the scripts and programs I use for processing. This is in my path:
=== grog@eureka (/dev/pts/27) ~/Photos/20120712 13 -> set|grep Tools
My main camera is an Olympus E-30, and I take photos in raw format. I also have an old Nikon “Coolpix” L1 compact camera which I carry with me at all times. In each case, I connect the camera to the computer via USB, and for the Olympus I have a script called syp that recognizes the date code of the images and creates a directory for that date if necessary, with a name like ~/Photos/20120712/ and a subdirectory ~/Photos/20120712/. The files are then read into ~/Photos/20120712/orig/ if they're not already there:
=== grog@eureka (/dev/pts/27) ~/Photos/20120712 12 -> syp
I don't currently do this with the Nikon because it's difficult to decide where the files belong, since they're just numbered sequentially. Instead, I use mcopy to copy them.
Most of my processing is done with JPEG images. For the Olympus, I first need to create them. I do this with DxO Optics “Pro”, which only runs on Microsoft and Apple, so I run it in a virtual machine running Microsoft. For this I have two scripts fordxo and fromdxo. fordxo links all the raw files that don't have a corresponding .jpg file into a directory called /Photos/00-Oly (for no particularly good reason). fromdxo looks for the resultant files with the extension -DxO.jpg (for example P7127469-DxO.jpg in that directory and moves them to the orig directory with the suffix .jpg. So for the file name orig/P7127469.ORF I would end up with a corresponding file orig/P7127469.jpg. fromdxo also puts in my name as author and copies the other EXIF data from the .ORF file.
The next step is to assign names to the photos. I have two different ways to do this: the older script gn, which prompts for a name for each image. It's intended to be used in conjunction with a separate display of the images themselves. The newer version is web based:
=== grog@eureka (/dev/pts/21) ~/Photos/20120712 69 -> make contacts
This builds a directory in /grog/localtmp/contacts/20120712 with the following page:
I enter the names of the images I want in the fields below. There are a number of short cuts:
Entering the single character = (equals sign) tells the script to use the name of the source file.
The single character , (comma) tells the script to take the previous file name, presumably in the form Grapefruit-1 (in particular, a text with a dash (-) and a number at the end, and generate a new name with the number incremented: Grapefruit-2. This can be repeated.
A partial name and a comma will search for the last name that starts with the partial name, and then increment the digit at the end.
The single character ! (exclamation mark) tells the script to perform the “comma” increment operation continually until the next field that has been filled in. In the example, it would generate the names Grapefruit-2, Grapefruit-3 and Grapefruit-4.
This script has little error checking. The comma and exclamation mark commands will do all sorts of silly things if the name they find doesn't conform to their expectations. But that's OK: you can always do it again.
Next the files need to be converted to a form for publishing on the web. That's the convert target:
=== grog@eureka (/dev/pts/27) ~/Photos/20120712 28 -> make convert
The contact print script has created a file called Makejpeg, which gets copied back into the top-level directory for the day. The make target uses this file to convert the images:
=== grog@eureka (/dev/pts/21) ~/Photos/20120712 71 -> l
As the next step I run an old version of Ashampoo Photo Optimizer, another Microsoft-space program that I got for free some time ago. It frequently improves the appearance of the images. I haven't upgraded because the usage of the newer versions is even more emetic, and to get it to work at all in my environment (under Wine) I had to hack the binaries to get it to call its backup directory _Ashampoo_Photo_Optimizer_Backup instead of _Ashampoo Photo Optimizer Backup, and also wrote a script photoopt that links only the files that haven't been optimized to a new directory ~/Photos/Bloody-stupid-ashampoo, and then starts Wine pointing at that directory so that you can select all files and optimize them all. It then moves them back to the base directory (optimized versions) and the directory _Ashampoo_Photo_Optimizer_Backup (originals) and creates a comparison web page processing/compare.php with the original on the left and the optimized version on the right. Running the mouse cursor over the “before” image shows the “after” image for better comparison.
If any of the “optimized” images turn out to be worse, the simplest way to fix it is to move the file in _Ashampoo_Photo_Optimizer_Backup back to the base directory.
When all that is done, it's time to generate the web pages:
=== grog@eureka (/dev/pts/27) ~/Photos/20120712 29 -> make web
This performs the following steps:
Create the directory hierarchy /grog/Photos/20120712 with subdirectories big, small and tiny.
Link the images in the base directory to /grog/Photos/20120712. This means that both directories must be in the same file system.
Convert the images to “small” images (currently 270 kP, or nominally 600x450 pixels) in the directory small and “tiny” images (currently 67.5 kP, or nominally 300×225 pixels).
Create EXIF files (Grapefruit-1.exif etc), a list of photos and a description line in the base web directory /grog/Photos/20120712.
Update a file ~/public_html/Photos/dirlist with a one-line description of the photos. This is the description from the contact print page along with a directory name:
The photos can be viewed via the web page /grog/photos/Photos.php?dirdate=20120712. The dirdate is the only thing that it needs to locate the images.
The code for the web pages is in PHP. The main function is showphoto():
Normally only one parameter is used. It implicitly takes the user's base directory (/grog) and appends the name. Note that it's not a complete relative path name: the real photos are in Photos/20120630/tiny/garden-path-ne-old.jpeg, Photos/20120630/small/garden-path-ne-old.jpeg and Photos/20120630/big/garden-path-ne-old.jpeg. If there's a second parameter, it's a “comparison image”: when JavaScript is enabled, running the mouse cursor over the image causes it to change to the second image. Here's the code above in action:
|
Other features of showphoto () are:
Four different sizes of display. Click repeatedly to show the “small” image, the “big” image at display width, and the “big” image at full size.
EXIF data display when JavaScript is enabled and the cursor runs over the image.
“Lazy loading”. When JavaScript is enabled, the image doesn't get loaded until it is displayed on the screen. This is especially important for big pages like this one with lots of images.
The image display functions are in php/includes/onephoto.php, currently 2,400 lines long. Interesting ones include:
oneimage (), similar to showphoto () but taking a URL as an argument. Many of the features of showphoto () are not implemented. The calling sequence is:
If present, $desc is a description (alt=) for the image. $height and $width may be omitted. If $height or $width are present, the image is displayed at that size with a link to the original unless $nolink is set.
youtube () displays a YouTube video given the ID. Look at the code for this one; it will probably change a lot.
For all this magic to work, I have a number of functions for web pages. The easiest way to show it is with an example of the header and footer of a typical page such as my skeleton file /grog/skel.php, also available in non-processed form:
The tarball includes four directories:
Photos/Tools is the tools. Some may be missing; let me know if you get any rude remarks. On my system it's located at /Photos/Tools, and there are probably implicit dependencies on that name.
The other files and directories are relative to /home/grog/public_html on my system. Again, there could be some unexpected dependencies. js and php contain the scripts.
photos contains the web pages for displaying the photos.
diary-jul2012.php is the source code for my diary for July 2012, as an example.
I have many more scripts, including ones that make panoramas and HDR images. I'll document them some other time, probably not until somebody asks me about them.
Greg's home page | Greg's diary | Greg's photos | Copyright |