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

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Photocopy

Copies or moves JPEG images from one location to another

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.

Usage

$ photocopy --options

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.

Requires

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 strongly 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

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

  • outdir = folder

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

  • action = string

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

  • cachefile = filename

    Specifies the name of the cachefile.

  • cvopt = string

    Adds ImageMagick options when action is cv for converting.

  • dirdepth = integer

    Sets 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

    Activates 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

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

    • date

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

    • uptime

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

  • limitcount = integer

    Adds threshold value for limitmode. The default is 0.

  • outext = string

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

  • recurse

    Recurses into all subfolders of the source directory.

  • dryrun

    Does not change the file system. Only simulates what would be done.

  • progress

    Enables or disables the use of a progress bar. Default is enabled.

  • help

    Prints a brief help message and exits.

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