Osamu Aoki's Image and Exif Utility (oaieu) (version: 0.1)
usage: oaieu [-h] [-v] [-q] {find,id,rm,r_exif,re,w_exif,we,org} ...
A collection of python scripts to organize digital camera image files in the
JPEG format. This program uses the exiv2 library via GObject introspection to
access the EXIF image meta data and PIL to access the image data, and sha256 to
generate the image identity hash string.
The common options across subcommands are specified right after the parent
command. STDIN and STDOUT are meant to be re-directed to files. The messaging
to the user uses only STDERR.
optional arguments:
-h, --help show this help message and exit
-v, --verbose verbose STDERR output: -v, -vv, -vvv
-q, --quiet no STDERR output
subcommands:
{find,id,rm,r_exif,re,w_exif,we,org}
action (use '-h' for more help)
find find JPEG files
id generate image identifier list and optionally remove
diplicates
rm remove files
r_exif (re) read EXIF data and act on it (no write back)
w_exif (we) read EXIF data and write back to it
org organize JPEG files
See https://github.com/osamuaoki/oaieu
Copyright (C) 2020 Osamu Aoki <[email protected]>
License: GPL 2.0+
oaieu find
usage: oaieu find [-h] [-f FILETYPE] [-j JPEG_EXT] [path]
find JPEG files at and under the specified basepath and print their path list
to STDOUT. The result is sorted in ASCII order.
positional arguments:
path find files found at and under this path (default='.')
optional arguments:
-h, --help show this help message and exit
-f FILETYPE, --filetype FILETYPE
FILETYPE to match: "jpeg" (default), "jpeg-matched-
datetime", "jpeg-skewed-datetime", "jpegmissing-
datetime", or "others". "jpeg-" can be used to match
all 2 "jpeg-*" with all 3 "datetime" data which may
produce better list. Files listed by "jpegmissing-
datetime" (or "jpegm") require manual attention in the
dollowinh processing. Specification can be shortened.
-j JPEG_EXT, --jpeg_ext JPEG_EXT
file extensions to match for JPEG files (comma
separated, case insensitive): ".jpg,.jpeg" (default)
oaieu id
usage: oaieu id [-h] [-p PRELOAD] [-u] [-n NUMBER]
read the JPEG file path list from the STDIN, calculate the image identifier
(ID, hash value for the JPEG image data), count up for each ID, print result
list in TSV to STDOUT, and optionally remove excess duplicates. STDOUT result
can be saved as PRELOAD and used to preload the counter in the following
processing. The difference of non-image data such as EXIF DateTimeOriginal are
ignored.
optional arguments:
-h, --help show this help message and exit
-p PRELOAD, --preload PRELOAD
preload the previous "oaieu id" STDOUT result saved as
PRELOAD
-u, --uniq remove excess duplicates -n NUMBER, --number NUMBER
number of duplicates allowed: 1 (default)
oaieu uniq
usage: oaieu uniq [-h] [-u] [-n NUMBER]
read the result of "id" sub-command run without "-u" to extract duplicated
image identifier list with different EXIF timestamp from the first checked one
in TSV to STDOUT and optionally remove excess duplicates. Instead of using
"id" sub-command with "-u", this sub-command should help you manually select
desired set of files. The STDIN and STDOUT of this "uniq" sub-command are the
same as STDOUT of "id" sub-command.
optional arguments:
-h, --help show this help message and exit
-u, --uniq remove excess duplicates (check ID only)
-n NUMBER, --number NUMBER
number of duplicates allowed: 1 (default)
oaieu rm
usage: oaieu rm [-h] [basepath]
read the file path list from the STDIN, remove them, and prune empty
directories at and under the specified basepath. This is meant to be used for
the file path list generated by 'oaieu find -f others'
positional arguments:
basepath prune directories at and under the specified basepath
(default='' disabled)
optional arguments:
-h, --help show this help message and exit
oaieu r_exif
usage: oaieu r_exif [-h] [action]
read the JPEG file path list from the STDIN, access EXIF data, and perform the
specified action on each file without writing back to it. The specified action
may be reporting EXIF data values for a certain set of EXIF tags to STDOUT, or
updating the file system timestamp of each file using the EXIF
DateTimeOriginal or other bast available DateTime* value
positional arguments:
action action to take: "date" (default, alias "1"), "date3" (alias
"3"), "update_timestamp" (alias "u"), "basic" (alias "b"),
"image" (alias "i"), "generic" (alias "g"), "all" (fallback).
optional arguments:
-h, --help show this help message and exit
oaieu w_exif
usage: oaieu w_exif [-h] [-f] [-k] [-s] [-b basedate | -d delta] [-a make] [-o model]
read the JPEG file path list from the STDIN, access EXIF data, and write back
EXIF data as specified. For '-b BASEDATE', new DateTimeOriginal,
DateTimeDigitized, and DateTime tags are added with specified values while
incremented evry 2 seconds matching the resolution of the VFAT file system.
For '-d DELTA', existing DateTimeOriginal values are adjusted with the
specified delta time; and DateTimeDigitized, and DateTime values are updated
if these were in-sync with DateTimeOriginal. Using '-f -d 0' updates
DateTimeDigitized, and DateTime values to match DateTimeOriginal value. You
must quote the argument option value containing '-' and ':'.
optional arguments:
-h, --help show this help message and exit
-f, --force force to add data even for preexisting cases and for
out-of-sync cases
-k, --keep keep original file by adding .keep to it
-s, --simulate simulate without writing back
-b BASEDATE, --basedate BASEDATE
specify the base date as: 'YYYY:mm:dd HH:MM:SS' or
'YYYY:mm:dd' or 'YYYYmmdd'
-d DELTA, --delta DELTA
specify the delta time as '[+|-|]HH:MM:SS' or
'[+|-|]HH:MM' or '[+|-|]HHMMSS' or '[+|-|]HHMM' or
'[+|-|]HH' or '[+|-|]H'
-a MAKE, --make MAKE specify the make
-o MODEL, --model MODEL
specify the model
oaieu org
usage: oaieu org [-h] [-r] [-m MODEL] [-s SPLIT] [-t TEMPLATE] [basepath]
read the JPEG file path list from the STDIN, access EXIF data, and organize
them by creating hardlinks under basepath (default "./NEW").
positional arguments:
basepath creating hardlinks under basepath
optional arguments:
-h, --help show this help message and exit
-r, --rm remove original link to the file
-m MODEL, --model MODEL
organize directory by the camera model before or after
the time based split: "no_split" (default), "before",
"after"
-s SPLIT, --split SPLIT
organize directory by the time split with resolution:
"default" (daymonth), "dayweek", "week", "month",
"year", "all"
-t TEMPLATE, --template TEMPLATE
filename template:
"I%y%m%d_%H%M%S_{model:.2}_{size:.4}" (default).
{model} and {size} are substituted with respective
hash values. "I%H%M%S{size:.1}" can make 8 char
filename.