Skip to content

A Python script to fetch data from a digital camera, rotating image files, renaming according to my file name convention.

License

Notifications You must be signed in to change notification settings

novoid/fetchphotos

Repository files navigation

Be careful - this repository is in status Alpha!

fetchphotos

This script gets data from the SD storage card of my digital camera to my computer. It rotates portrait format images and renames files according to my file name convention.

Please note: this is a replacement for a quick-hack shell script: https://github.com/novoid/getdigicamdata.sh

It is part of a blog article, where I describe my work-flows on how I manage my photographs and more: http://karl-voit.at/managing-digital-photographs/

Usage

fetchphotos gets image files from the source directory (specified in the configuration file), and moves the finished files to the destination directory. Along the way, it can add a timestamp to the file name, rotate the image, and make the filename lowercase.

Examples

If you haven’t run fetchphotos before, type

fetchphotos.py --generate-configfile

… will generate a skeleton configuration file (and say where the file is). You will need to edit this file and provide value for the source and destination directories (look for “replace me!”).

fetchphotos.py

… will take all the image files in the source directory, rotate them as appropriate, add timestamps to the file names, convert the file names to lowercase, and put these files in the destination directory.

fetchphotos.py /some/directory/*.jpg

… will transform the files as above, but will only use the files in /some/directory/*.jpg as the source images.

fetchphotos.py --help

… will print a complete list of options.

Configuration file reference

General:DIGICAMDIR

The directory where the camera files are located. This can be a location on the camera itself, if it’s mounted as an external drive, or if you need to run a program to get pictures off the camera, the directory where that program stores the pictures.

This value has no default. It must be specified before use.

General:DESTINATIONDIR

The directory where the processed files will be copied to.

This value has no default. It must be specified before use.

File_processing:ROTATE_PHOTOS

Rotate the photo according to EXIF data in the image, if available. It can be ‘true’ or ‘false’.

This value has a default of ‘true’.

File_processing:ADD_TIMESTAMP

Add timestamp according to ISO 8601+ http://datestamp.org/index.shtml can be one of ‘true’ or ‘false’ example: if true, file ‘foo.jpg’ will end up in ‘2009-12-31T23.59.59_foo.jpg’ Note that the time used comes from the EXIF metadata in the image, if available, and from the creation date of the image file otherwise.

This value has a default of ‘true’.

File_processing:LOWERCASE_FILENAME

Rename files to lowercase. Can be one of ‘true’ or ‘false’. Example: if true, file ‘Foo.JPG’ will end up in ‘foo.jpg’.

This value has a default of ‘true’.

File_processing:KEEP_ORIGINALS

Don’t delete the files in DIGICAMDIR. If you have confidence that fetchphotos does what you want, you can set this to false.

KEEP_ORIGINALS=true

About

A Python script to fetch data from a digital camera, rotating image files, renaming according to my file name convention.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages