menu.
</para>
</section>
+ <section id="Exifdatetimetofile">
+ <title>Exif datetime to file</title>
+ <para>
+ Sets the file datetime (mtime) to the Exif.Image.DateTimeOriginal value. If the exif tag does not exist, no action is taken.
+ <para />
+ This may be useful if you wish to sort on Exif.Image.DateTimeOriginal. This requires that the metadata for all files in the folder must be read each time. This is time consuming. If this operation is carried out when images are imported from the camera, future sorting can utilize file datetime which will be much faster.
+ </para>
+ <para>
+ This item is displayed in the
+ <emphasis role="strong">Plugins</emphasis>
+ menu.
+ </para>
+ </section>
<section id="Exportjpeg">
<title>Export jpeg</title>
<para>
--- /dev/null
+#!/bin/sh
+
+## @file
+## @brief Sets file mtime to the Exif.Image.DateTime of the file
+##
+## $@ List of files to be processed
+##
+## Requires exiv2 or exiftool
+##
+
+if [ -z "$(command -v exiv2)" ]
+then
+ if [ -z "$(command -v exiftool)" ]
+ then
+ zenity --title="Geeqie exif datetime to file" --info --width=200 --text="Neither exiv2 nor exiftran is installed" --window-icon=/usr/local/share/pixmaps/geeqie.png 2> /dev/null
+ exit 1
+ else
+ use_exiv2=false
+ fi
+else
+ use_exiv2=true
+fi
+
+if ! zenity --title="Geeqie - exif datetime to file" --question --text "Set file datetime (mtime) to Exif.Image.DateTime\n\nContinue?" --width=300 --window-icon=/usr/local/share/pixmaps/geeqie.png
+then
+ exit 0
+fi
+
+# exiv2 should be faster
+if [ "$use_exiv2" = "true" ]
+then
+ while [ $# -gt 0 ]
+ do
+ if date_time=$(exiv2 -g Exif.Image.DateTime -Pv "$1")
+ then
+ y_m_d_h_m_s=$(echo "$date_time" | tr ' ' ':')
+ y_m_d_h_m=$(echo "$y_m_d_h_m_s" | cut --delimiter ':' --fields '1 2 3 4 5' | tr --delete ':')
+ s=$(echo "$y_m_d_h_m_s" | cut --delimiter ':' --fields '6')
+ touch -m -t "$y_m_d_h_m.$s" "$1"
+ else
+ printf "Geeqie plugin exif-datetime-to-file -\nFile: %s does not have Exif.Image.DateTime\n" "$1"
+ fi
+ shift
+ done
+else
+ while [ $# -gt 0 ]
+ do
+ if date_time=$(exiftool -t -createdate "$1")
+ then
+ y_m_d_h_m_s=$(echo "$date_time" | cut --characters '13-31' | tr ' ' ':')
+ y_m_d_h_m=$(echo "$y_m_d_h_m_s" | cut --delimiter ':' --fields '1 2 3 4 5' | tr --delete ':')
+ s=$(echo "$y_m_d_h_m_s" | cut --delimiter ':' --fields '6')
+ touch -m -t "$y_m_d_h_m.$s" "$1"
+ else
+ printf "Geeqie plugin exif-datetime-to-file -\nFile: %s does not have Exif.Image.DateTime\n" "$1"
+ fi
+ shift
+ done
+fi
--- /dev/null
+geeqie-exif-datetime-to-file
\ No newline at end of file
--- /dev/null
+# This file is a part of Geeqie project (https://www.geeqie.org/).
+# Copyright (C) 2008 - 2022 The Geeqie Team
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#
+
+install_data('geeqie-exif-datetime-to-file', install_dir : gq_bindir)
+
+i18n.merge_file(
+ input : 'org.geeqie.exif-datetime-to-file.desktop.in',
+ output : 'org.geeqie.exif-datetime-to-file.desktop',
+ type : 'desktop',
+ po_dir : podir,
+ install : true,
+ install_dir : desktopdir)
--- /dev/null
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=Exif datetime to file
+Comment=Sets file mtime to the Exif.Image.DateTimeOriginal of the file
+
+# Requires exiv2 or exiftools
+
+Exec=geeqie-exif-datetime-to-file %F
+
+# Desktop files that are usable only in Geeqie should be marked like this:
+Categories=Graphics;
+OnlyShowIn=X-Geeqie;
+
+# It can be made verbose
+#X-Geeqie-Verbose=true
+
+Icon=geeqie
#
subdir('camera-import')
+subdir('exif-datetime-to-file')
subdir('export-jpeg')
subdir('geocode-parameters')
subdir('image-crop')