You're going to take a set of photos which you want to turn into an album in the Carter Family Photo Album. This happens infrequently enough that the details are forgotten each time and have to be re-researched. The specific project this time is our forthcoming trip to the Rhine river and Switzerland.
The root directory on Jacinth is /home/images. The URL of the toplevel index is http://jacinth.jfcarter.net/images/images-index/ (courtesy of a symlink from /home/httpd/htdocs/images to the containing directory). You don't need to mess with index.shtml in that directory but you do need to update index.incl.
The second level volumes are about 50Mb to 100Mb in size. If you need to make a new one, it's called images(number), e.g. images07. Make that directory, and copy into it index.shtml from a recent previous volume. Edit index.shtml updating all the years and all the instances of the volume number. The index includes ../images-index/index.incl. Edit that file putting in a row for the new volume, and adjust the year of the previous one, which likely will end with … (…).
Pick a name for your album, typically ending with the year so it is unique, e.g. europe13. Make a directory for the original photo images: /home/images/images.orig/europe13. Make the album directory /home/images/images07/europe13. Change into it so the examples can be relative paths. For the examples I'm copying files from a neighboring album called xyz13. Do these steps:
mkdir ./img # Most of the content ends up here
cp ../xyz13/rebuild.sh .
ln -s ../../images.orig/europe13 ./orig
Execute rebuild.sh to create all the generated content. If you edit the HTML files above the marker line, your changes will be preserved. If you do photo editing on an image, it will not be overwritten. If you need a file to be rebuilt, e.g. because the orientation was wrong, remove it first. The script goes like this (comments omitted):
#!/bin/bash
dir=${0%/*}
if [ "$dir" = "$0" ] ; then dir=. ; fi
cd $dir || exit 4
../../bin/mogrify.pl photolog.txt index.html ./orig img
Basically the middle 3 lines change to the album directory so the arguments to mogrify.pl can be relative paths, which is essential to get the HTML links right. The arguments are:
Create the file ./photolog.txt (see next section).
The photo log file lists the images in the album, in order of appearance. Normally you will edit it on your pocket computer, not Jacinth. Lines beginning with #, and empty lines, are ignored. Remaining lines have three fields separated by whitespace. (I normally use tabs, but blank(s) will work.) They are:
Basename of the image. This will be sought in ./orig/${BASENAME}. You will need to figure out what names your cameras use (different for each); then you can use copy&paste to advantage.
Action letter, as follows, not case sensitive. See mogrify.pl for details.
Caption or other text. It of course may contain whitespace, but it has to be all on one (long) line. In most cases the caption has a role like a title, but you can put in a percent and follow it with additional text which will be set in a following paragraph in the appropriate context. For example, on the index page the titles are under the thumbnails, but in an individual photo container the paragraph, if any, follows the title. HTML markup is legal, e.g. you might conceivably have multiple paragraphs.
You will want to create this file on your pocket computer and periodically upload it to Jacinth. I have it on Selen in /storage/sdcard1/photolog.txt and a script in the same directory. Do:
sh /storage/sdcard1/jimc/pholog.sh #(wants password)
The script contains:
#!/system/bin/sh
src=/storage/sdcard1/jimc/photolog.txt
dst=jimc@jacinth.jfcarter.net:/home/images/images07/europe13/
rsync --log-format="%o %f" -t $src $dst
The #! line is useless because the SD card is mounted with the noexec option. I put in the --log-format option because I prefer the more informative format and I want confirmation that something was actually sent. The -t option is not so important for photolog.txt but is important for directories because otherwise rsync sees that the mod times do not agree and it thinks that unchanged files need to be sent over again.
This description is for Selen (CyanogenMod-10 based on Android-4.1 Jelly
Bean
) and Mica (CyanogenMod-10.1 based on Android-4.2 Super Jelly
Bean
. Images that you have taken with the cellphone camera end up in
/storage/sdcard0/DCIM/Camera. Naming example (case sensitive):
IMG_20121221_140612.jpg which is IMG_${date}_${time}.jpg. To upload them,
I copied the above pholog.sh script and made minor changes: -r to recurse
into the directory, and the destination has to be …/orig/.
#!/system/bin/sh
src=/storage/sdcard0/DCIM/Camera/
dst=jimc@jacinth.jfcarter.net:/home/images/images07/europe13/orig/
rsync --log-format="%o %f" -r -t $src $dst
When importing from the camera …
Connect the USB cable (type A to mini-USB) from Mica's dock to the camera; open the east cover labelled HDMI/AV/Digital. The camera should be turned off when you are connecting the cable.
Wake up Mica, then turn on the camera. The Gallery app auto launches.
There will be a directory for Canon Inc. Canon Power…
.
Click on it.
You get a thumbnail sheet with all items preselected. De-select photos already transferred (it's not a big deal if you re-download something by mistake.)
In the upper right corner is an icon labelled Import. Hit it.
It will copy the images and then say Import Complete
.
Hit back
to revert to Gallery's folder page. Just exit
from Gallery unless you want to review the photos.
Turn off the camera and disconnect the cable.
Start up VX ConnectBot, the local shell.
Execute: sh /storage/sdcard1/jimc/phoimg.sh
The images are uploaded with a confirmation line for each one.
Back to Gallery. Are we going to leave images on the tablet? Yes, let's do so for the moment.
In VX ConnectBot get a shell session (as yourself) on Jacinth.
Change directory (cd) to the project directory: /home/images/images07/europe13 (actually this is optional).
Execute ./rebuild.sh
You may view the new content on the project's webpage.