Skip to content

Copy or move JPEG images from one location to another

License

Notifications You must be signed in to change notification settings

mboljen/photocopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Photocopy

Copies or moves JPEG images from one location to another

Synopsis

$ photocopy [OPTION]...

The script can be invoked using zero, one or two arguments.

  • If it is invoked using two arguments, the first argument holds the source directory srcdir and the second argument holds the output directory outdir.

  • If it is invoked using one argument and this argument is an existing directory, it is assigned as output directory outdir. The current working directory is assumed to be the source directory srcdir.

  • If it is invoked using one argument and this argument is an existing file, it is used as configuration file containing options as key-value-pairs. Additional command line options will override the settings in the configuration file.

  • If it is invoked using one argument and this argument is a string, it is used as a basename for a configuration file with the file extension .rc. This file needs to reside in the directory ~/.photocopy. Additional command line options will override the settings in the configuration file.

Description

The script photocopy transfers JPEG images from the source directory srcdir to the output directory outdir. Image files can be copied, moved or converted.

The script can be used to transfer images from a photo camera to a local image repository or to upload the most recent images from a local image repository to a remote location. For the latter, photocopy can be configured to automatically remove images from the remote location that exceed a certain threshold.

Files at the output location will be renamed to a unique filename based upon the EXIF original timestamp of the source file.

Warning

It is recommended to reserve the output directory outdir exclusively for photocopy and not to use it for any other purpose, especially when the option limitmode is enabled. If the latter is true, unregistered files in outdir matching the same file extension will be removed. It is recommended to enable dryrun to see what would happen.

Options

  • --srcdir = folder

    Specify the name of the source directory. The source directory must exist and the user must have read permission.

  • --outdir = folder

    Specify the name of the output directory. The output directory must exist and the user must have write permission.

  • --action = string

    Specify the transfer action. Valid values are cp for copying, mv for moving and cv for converting.

  • --cachefile = filename

    Specify the name of the cachefile.

  • --cvopt = string

    Add ImageMagick options when action is cv for converting.

  • --dirdepth = integer

    Set number of subfolders within directory outdir. Valid values are 1, 2 and 3.

  • --dirfmt1 | --dirfmt2 | --dirfmt3 = string

    Use strftime flags to label subfolders in directory outdir. The default setting is %Y for subfolder 1, %m for subfolder 2 and %d for subfolder 3.

  • --limitmode = string

    Activate flag to limit files at directory outdir. Use none (default) to disable this option. If set, this option requires limitcount being set to a positive value. The following modes are available:

    • num

      Limit the number of image files to the most recent ones.

    • date

      Remove images when their EXIF datetime is older than a certain amount of days from today.

    • uptime

      Remove images after a certain amount of days of being uploaded.

  • --limitcount = integer

    Add threshold value for limitmode. The default is 0.

  • --outext = string

    Specify the format of the images at the output directory. The default is JPG.

  • --recurse

    Recurse into all subfolders of the source directory.

  • --dryrun

    Do not change the file system. Only simulate what would be done.

  • --progress

    Enable or disable the use of a progress bar. Default is enabled.

  • --help

    Print a brief help message and exit.

Requirements

Installation

Use the following command to install this software:

$ make
$ make install

The default PREFIX is set to /usr/local. In order to successfully complete the installation, you need to have write permissions for the installation location.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

Copy or move JPEG images from one location to another

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published