NAME

Image::Synchronize - a module for synchronizing filesystem modification timestamps of images, movies, and related files.

SYNOPSIS

use Image::Synchronize;

$ims = Image::Synchronize->new(%options);
$ims->process(@pathpatterns);

DESCRIPTION

This module is the backend of imsync and was not designed to be used outside of that context.

SEE ALSO

See the documentation of imsync for more details.

AUTHOR

Louis Strous, <imsync@quae.nl<gt>

COPYRIGHT AND LICENSE

Copyright (C) 2018-2023 by Louis Strous

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.26.2 or, at your option, any later version of Perl 5 you may have available.

METHODS

new

$ims = Image::Synchronize->new(%options);

Construct and return a new instance of the class. The following %options keys are recognized:

logfile

Specifies the file to write the log messages to (in addition to printing them to standard output). If not set, then imsync.log in the current working directory is used.

process

$ims->process(@arguments);

Processes the specified @arguments, of which the elements are interpreted as path name patterns matching files and/or directories.

Returns $ims.

get_image_info

$et->get_image_info($file);

Extract relevant information from the $file, using Image::ExifTool, and returns a reference to a hash map containing the extracted information. The extracted tags are:

CreateDate
DateTimeOriginal
Duration
FileModifyDate
GPSAltitude
GPSAltitudeRef
GPSDateTime
GPSLatitude
GPSLatitudeRef
GPSLongitude
GPSLongitudeRef
ImageWidth
Make
MIMEType
Model
QuickTime:CreationDate
SerialNumber
XMP:CameraID
XMP:ImsyncVersion
XMP:TimeSource
XMP:ExiftimeVersion

Some of the requested tags may occur in the embedded information multiple times (for example, once as an EXIF tag and once as an XMP tag). We store all occurrences in the returned map, with keys that consist of the requested tag name with the tag group (= source) name prefixed, separated by a colon (e.g., "Exif:DateTimeOriginal"). Additionally, the preferred occurrence is stored in the map with a key that has only the tag name without the group name (e.g., "DateTimeOriginal").

If the ImageWidth tag is present, then the file is considered to be an image, and then the returned hash map also includes the effective camera ID, as the value for key effective_camera_id. The ImageWidth tag is omitted from the hash map.

QuickTime images/movies (recognized by there being a QuickTime:CreateDate tag) get '|U' appended to their effective camera ID, and the QuickTime::CreateDate tag is omitted from the hash map.

Each value is stored for the Image::ExifTool tag including the group name, and also for the tag without the group name. If a value occurs in multiple groups (for example EXIF and XMP), then the preferred value is stored for the tag without the group name.