Gallery v0.2.1 documentation
HOWTO¶
Merge in New Galleries¶
If you are anything like me you will have a setup where you keep putting new photos in a To Burn folder until you have enough to burn to DVD at which point you burn them and put a copy on a shared drive. You then generate thumbnails, metadata etc from the copy on the shared drive and generate galleries from the metadata.
This all works very well until you want to generate a gallery from the unfilled To Burn folder because the usual set up for syncing the galleries doesn’t work.
My To Burn folder is called Unfinished but when it is full it will be called Photos 10. Within the Unfinished folder is a 2009-07-18 Rolands Caterham folder which I want to make a gallery from. The existing gallery folders are all in /home/james/Desktop/Sites/JimmygSite/code/trunk/jimmygsite/static/bin/photos
First you need to create the gallery files such as the thumbnails etc. In this case the origin directory will be the directory containing the Unfinished folder. This origin directory shouldn’t contain any other files or folder or they will be added too. Also you should ensure there isn’t already an Unfinished folder in the destination directory sub-directories or things might get over-written or confused.
Once it is all OK you can run these commands:
export G_SRC=/home/james/Desktop/Archive/Photos
export G_DST=/home/james/Desktop/Sites/JimmygSite/code/trunk/jimmygsite/static/bin/photos
~/env/bin/python -m gallery convert --gallery-exif $G_SRC $G_DST
~/env/bin/python -m gallery convert --gallery-still $G_SRC $G_DST
~/env/bin/python -m gallery convert --gallery-reduced $G_SRC $G_DST
~/env/bin/python -m gallery convert --gallery-thumb -y $G_SRC $G_DST
~/env/bin/python -m gallery convert --gallery-h264 $G_SRC $G_DST
~/env/bin/python -m gallery convert --gallery-meta $G_SRC $G_DST
Or to do it all in just one step:
export G_SRC=/home/james/Desktop/Archive/Photos
export G_DST=/home/james/Desktop/Sites/JimmygSite/code/trunk/jimmygsite/static/bin/photos
~/env/bin/python -m gallery convert --gallery-exif --gallery-still --gallery-reduced --gallery-thumb -y --gallery-h264 --gallery-meta $G_SRC $G_DST
Once all the thumbnails are converted you can automatically generate the galleries into a galleries directory:
mkdir all
~/env/bin/python -m gallery autogen $G_DST/meta all
The all/Photos 10/2009-07-18 Rolands Caterham directory will now contain the index.gallery file you need. Put it somewhere under the gallery, perhaps in a life/photo/caterham directory. Now to create the HTML you need to convert and then update the gallery:
~/env/bin/python -m sitetool.command convert -gur -c about.html -S life/photo/caterham
~/env/bin/python -m sitetool.command update -rCL -c about.html -S life/photo/caterham
Delete Old Files¶
~/env/bin/python -m gallery cleanup --exclude "Unfinished/" $G_SRC $G_DST
INFO: Listing files in '1024'
INFO: Listing files in 'exif'
INFO: Listing files in '150'
INFO: Listing files in 'h264'
INFO: Listing files in 'source'
INFO: Listing files in 'meta'
INFO: Listing files in 'still'
Show the list of 47 file(s) to delete: [y/N] n
Delete the files? [y/N] y
Deleting...
Finished.