[opensuse] Photo taken/file creation date advice.
HI Has anyone found an easy to use tool/script to update a photo file creation date/time to the date/time that the photo was taken? I'm having to change all my girlfriends' photos taken on her phone that are backed up to Windows 7 (ugh) and then transferred via samba into the digikam system. Regards Ian -- Qt: 5.6.1 KDE Frameworks: 5.24.0 kf5-config: 1.0 plasmashell 5.7.1 Kernel: 4.6.3-1-default "openSUSE Tumbleweed (20160710) (x86_64)" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* ianseeks <ianseeks@btinternet.com> [07-13-16 07:38]:
HI
Has anyone found an easy to use tool/script to update a photo file creation date/time to the date/time that the photo was taken? I'm having to change all my girlfriends' photos taken on her phone that are backed up to Windows 7 (ugh) and then transferred via samba into the digikam system.
I *assume* you mean making the file date/time match the exif file creation time which *should* match the date/time taken??? exiftool or exiv2 will accomplish this. I prefer exiv2 as it is compiled and much quicker as exiftool is a perl "script". I do: exiv2 -T ./*.{nef,jpg} you might change to: exiv2 -T ./*.jpg changes the file date/time to match the exif image creation date/time w/o changing the file name. I go further and change the image file name to match creation date/time: exiv2 mv \-k \-r %y%m%d_%H%M%S_:basename: \.\/*.{nef,jpg}' results: 160713_075208_dsc9817.jpg YYMODA HHMMSS orig_file_name I have quite an extensive collection over the last ~12 years, mostly sporting events (youth soccer), ~70000 the last four years in darktable. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wednesday, 13 July 2016 07:55:35 BST Patrick Shanahan wrote:
* ianseeks <ianseeks@btinternet.com> [07-13-16 07:38]:
HI
Has anyone found an easy to use tool/script to update a photo file creation date/time to the date/time that the photo was taken? I'm having to change all my girlfriends' photos taken on her phone that are backed up to Windows 7 (ugh) and then transferred via samba into the digikam system.
I *assume* you mean making the file date/time match the exif file creation time which *should* match the date/time taken???
exiftool or exiv2 will accomplish this. I prefer exiv2 as it is compiled and much quicker as exiftool is a perl "script".
I do: exiv2 -T ./*.{nef,jpg}
you might change to: exiv2 -T ./*.jpg
changes the file date/time to match the exif image creation date/time w/o changing the file name.
I go further and change the image file name to match creation date/time: exiv2 mv \-k \-r %y%m%d_%H%M%S_:basename: \.\/*.{nef,jpg}'
results: 160713_075208_dsc9817.jpg YYMODA HHMMSS orig_file_name
I have quite an extensive collection over the last ~12 years, mostly sporting events (youth soccer), ~70000 the last four years in darktable.
Thanks Patrick, that looks the ticket. I shall go and give a spin now. -- Qt: 5.6.1 KDE Frameworks: 5.24.0 kf5-config: 1.0 plasmashell 5.7.1 Kernel: 4.6.3-1-default "openSUSE Tumbleweed (20160710) (x86_64)" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* ianseeks <ianseeks@btinternet.com> [07-13-16 08:02]:
On Wednesday, 13 July 2016 07:55:35 BST Patrick Shanahan wrote:
* ianseeks <ianseeks@btinternet.com> [07-13-16 07:38]:
HI
Has anyone found an easy to use tool/script to update a photo file creation date/time to the date/time that the photo was taken? I'm having to change all my girlfriends' photos taken on her phone that are backed up to Windows 7 (ugh) and then transferred via samba into the digikam system.
I *assume* you mean making the file date/time match the exif file creation time which *should* match the date/time taken???
exiftool or exiv2 will accomplish this. I prefer exiv2 as it is compiled and much quicker as exiftool is a perl "script".
I do: exiv2 -T ./*.{nef,jpg}
you might change to: exiv2 -T ./*.jpg
changes the file date/time to match the exif image creation date/time w/o changing the file name.
I go further and change the image file name to match creation date/time: exiv2 mv \-k \-r %y%m%d_%H%M%S_:basename: \.\/*.{nef,jpg}'
results: 160713_075208_dsc9817.jpg YYMODA HHMMSS orig_file_name
I have quite an extensive collection over the last ~12 years, mostly sporting events (youth soccer), ~70000 the last four years in darktable.
Thanks Patrick, that looks the ticket. I shall go and give a spin now.
I go one step further, windoz upper-cases most filenames, I include lowercasing the filename in the same renaming steps above: <script.........> #!/bin/sh # lowercase_filenames - a shell script to convert filenames to lower case # underscore_filenames - a shell script to change blanks to underscores # Author: Christian Steinruecken <cstein@suse.de> # self=`basename $0` force="" verbose="" convert() { x="$1" # convert to lowercase case $self in lowercase_filenames) newname=`echo "$x" | tr '[A-Z]' '[a-z]'` ;; underscore_filenames) newname=`echo "$x" | tr '[:blank:]' '_'` esac if [ ! "$x" = "$newname" ]; then # preserve time stamp realdate=`date +%Y%m%d%H%M.%S -r "$x"` # this is required on VFAT partitions [ -n "$verbose" ] && echo "$x -> $newname" mv -i "$x" "${newname}__N_E_W__" mv -i "${newname}__N_E_W__" "${newname}" # restore time stamp touch -m -t "${realdate}" "${newname}" fi } alpha() { y="$1" b=`basename "$1"` if [ -e "$y" ]; then if [ "$force" = "1" ]; then convert "$y" else if [ "$b" = "Makefile" -o "$b" = "Mail" ]; then echo "$self: $y: Cowardly refusing to convert this (use --force)..." >&2 elif [ ! -f "$y" -a ! -d "$y" ]; then echo "$self: $y: Special file, skipping..." >&2 else convert "$y" fi fi else echo "$self: $y: No such file or directory." >&2 fi } show_help() { echo "Usage: $self [options] [files...]" case $self in lowercase_filenames) echo "Converts filenames to lowercase." echo "Options must be specified BEFORE the files." ;; underscore_filenames) echo "Converts blanks in filnames to underscores." esac echo "If no files are given, all files in the current working directory will be" echo "used. Options include:" echo echo " -v, --verbose Verbose operation" if [ $self == lowercase_filenames ]; then echo " -f, --force Also convert Makefiles, hidden and special files" fi echo " -h, --help Display this help" echo } while [ -n "$1" ]; do case "$1" in "-h"|"--help") show_help; exit 0 ;; "-f"|"--force") force="1"; shift ;; "-v"|"--verbose") verbose="1"; shift ;; *) break ;; esac done if [ -n "$*" ]; then # convert all files (given as parameters) for i in "$@"; do alpha "$i" done else # take all files in current working directory if [ -n "$force" ]; then for i in .* *; do alpha "$i" done else for i in *; do alpha "$i" done fi fi exit 0 </script........> -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Thanks Patrick. On Wednesday, 13 July 2016 08:11:24 BST Patrick Shanahan wrote:
* ianseeks <ianseeks@btinternet.com> [07-13-16 08:02]:
On Wednesday, 13 July 2016 07:55:35 BST Patrick Shanahan wrote:
* ianseeks <ianseeks@btinternet.com> [07-13-16 07:38]:
HI
Has anyone found an easy to use tool/script to update a photo file creation date/time to the date/time that the photo was taken? I'm having to change all my girlfriends' photos taken on her phone that are backed up to Windows 7 (ugh) and then transferred via samba into the digikam system.
I *assume* you mean making the file date/time match the exif file creation time which *should* match the date/time taken???
exiftool or exiv2 will accomplish this. I prefer exiv2 as it is compiled and much quicker as exiftool is a perl "script".
I do: exiv2 -T ./*.{nef,jpg}
you might change to: exiv2 -T ./*.jpg
changes the file date/time to match the exif image creation date/time w/o changing the file name.
I go further and change the image file name to match creation date/time: exiv2 mv \-k \-r %y%m%d_%H%M%S_:basename: \.\/*.{nef,jpg}'
results: 160713_075208_dsc9817.jpg
YYMODA HHMMSS orig_file_name
I have quite an extensive collection over the last ~12 years, mostly sporting events (youth soccer), ~70000 the last four years in darktable.
Thanks Patrick, that looks the ticket. I shall go and give a spin now.
I go one step further, windoz upper-cases most filenames, I include lowercasing the filename in the same renaming steps above:
<script.........>
#!/bin/sh # lowercase_filenames - a shell script to convert filenames to lower case # underscore_filenames - a shell script to change blanks to underscores # Author: Christian Steinruecken <cstein@suse.de> #
self=`basename $0` force="" verbose=""
convert() { x="$1" # convert to lowercase case $self in lowercase_filenames) newname=`echo "$x" | tr '[A-Z]' '[a-z]'` ;; underscore_filenames) newname=`echo "$x" | tr '[:blank:]' '_'` esac if [ ! "$x" = "$newname" ]; then # preserve time stamp realdate=`date +%Y%m%d%H%M.%S -r "$x"` # this is required on VFAT partitions [ -n "$verbose" ] && echo "$x -> $newname" mv -i "$x" "${newname}__N_E_W__" mv -i "${newname}__N_E_W__" "${newname}" # restore time stamp touch -m -t "${realdate}" "${newname}" fi }
alpha() { y="$1" b=`basename "$1"` if [ -e "$y" ]; then if [ "$force" = "1" ]; then convert "$y" else if [ "$b" = "Makefile" -o "$b" = "Mail" ]; then echo "$self: $y: Cowardly refusing to convert this (use --force)..." >&2 elif [ ! -f "$y" -a ! -d "$y" ]; then echo "$self: $y: Special file, skipping..." >&2 else convert "$y" fi fi else echo "$self: $y: No such file or directory." >&2 fi }
show_help() { echo "Usage: $self [options] [files...]"
case $self in lowercase_filenames) echo "Converts filenames to lowercase." echo "Options must be specified BEFORE the files." ;; underscore_filenames) echo "Converts blanks in filnames to underscores." esac
echo "If no files are given, all files in the current working directory will be" echo "used. Options include:" echo echo " -v, --verbose Verbose operation"
if [ $self == lowercase_filenames ]; then echo " -f, --force Also convert Makefiles, hidden and special files" fi
echo " -h, --help Display this help" echo }
while [ -n "$1" ]; do case "$1" in "-h"|"--help") show_help; exit 0 ;; "-f"|"--force") force="1"; shift ;; "-v"|"--verbose") verbose="1"; shift ;; *) break ;; esac done
if [ -n "$*" ]; then # convert all files (given as parameters) for i in "$@"; do alpha "$i" done else # take all files in current working directory if [ -n "$force" ]; then for i in .* *; do alpha "$i" done else for i in *; do alpha "$i" done fi fi exit 0
</script........>
-- Qt: 5.6.1 KDE Frameworks: 5.24.0 kf5-config: 1.0 plasmashell 5.7.1 Kernel: 4.6.3-1-default "openSUSE Tumbleweed (20160710) (x86_64)" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2016-07-13 13:55, Patrick Shanahan wrote:
I *assume* you mean making the file date/time match the exif file creation time which *should* match the date/time taken???
exiftool or exiv2 will accomplish this. I prefer exiv2 as it is compiled and much quicker as exiftool is a perl "script".
I do: exiv2 -T ./*.{nef,jpg}
you might change to: exiv2 -T ./*.jpg
changes the file date/time to match the exif image creation date/time w/o changing the file name.
I will do this :-)
I go further and change the image file name to match creation date/time: exiv2 mv \-k \-r %y%m%d_%H%M%S_:basename: \.\/*.{nef,jpg}'
results: 160713_075208_dsc9817.jpg YYMODA HHMMSS orig_file_name
Mmm. Interesting, but this breaks the existing database. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
* Carlos E. R. <robin.listas@telefonica.net> [07-13-16 08:13]:
On 2016-07-13 13:55, Patrick Shanahan wrote:
I *assume* you mean making the file date/time match the exif file creation time which *should* match the date/time taken???
exiftool or exiv2 will accomplish this. I prefer exiv2 as it is compiled and much quicker as exiftool is a perl "script".
I do: exiv2 -T ./*.{nef,jpg}
you might change to: exiv2 -T ./*.jpg
changes the file date/time to match the exif image creation date/time w/o changing the file name.
I will do this :-)
I go further and change the image file name to match creation date/time: exiv2 mv \-k \-r %y%m%d_%H%M%S_:basename: \.\/*.{nef,jpg}'
results: 160713_075208_dsc9817.jpg YYMODA HHMMSS orig_file_name
Mmm. Interesting, but this breaks the existing database.
yes, somewhat forward looking if one has many photos. I use darktable which make an xmp file matching the photo filename and contains all modification information for the photo. It is simple to also rename the xmp file to match the photo filename and re-import into darktable. I don't know about digikam, first looks some years back made me look further. I elected bibblepro which operated quite similarily to darktable. and I elected my filenaming prior to bibble. one chooses his own poison :) ps: bibble was sold to corel who collects entities in the manner of m$ and resulting effect are very similar, worthless apps. (bibble provided m$, mac and linux apps, including an rpm package.) -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 07/13/2016 07:55 AM, Patrick Shanahan wrote:
exiftool or exiv2 will accomplish this. I prefer exiv2 as it is compiled and much quicker as exiftool is a perl "script".
I hear what you say, Patrick. My download scripts are all for exiftool. How compatible wrt command line options & parameters is exiv2? -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* Anton Aylward <opensuse@antonaylward.com> [07-13-16 08:15]:
On 07/13/2016 07:55 AM, Patrick Shanahan wrote:
exiftool or exiv2 will accomplish this. I prefer exiv2 as it is compiled and much quicker as exiftool is a perl "script".
I hear what you say, Patrick. My download scripts are all for exiftool. How compatible wrt command line options & parameters is exiv2?
commands are different but similar, results in what-I-want and probably also for you. I believe more comprehensive actions are available with exiftool but I am not an expert with either. I experimentented until I had desired results :) I essentially: copy from card to directory dup to another directory lowercase and redate file rename to match date dup results work machine transfer worked images to final resting place where my server can see del first dup my lowercase script is in another post in this thread -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (4)
-
Anton Aylward
-
Carlos E. R.
-
ianseeks
-
Patrick Shanahan