What I want to do is reorganize files in my Camera Roll folder. Using the creation date I want to Put them inside folders according to Year/Month Format using their creation date.
In this answer, they explain how to make folders and organize them: https://stackoverflow.com/a/1314394/4980886
#!/bin/bash
find $PHOTO_DIR -regextype posix-extended -type d -regex '.*/[0-9]{4}/[0-9]{2}/[0-9]{2}$' |
while read dir; do
newdir="$(echo $dir | sed 's@/\([0-9]\{4\}\)/\([0-9]\{2\}\)/\([0-9]\{2\}\)$@/\1-\2-\3@')"
mv "$dir" "$newdir"
rmdir "$(dirname $dir)"
rmdir "$(dirname $(dirname $dir))"
done
But it doesn't address how to get the creation date, maybe I should get the metadata from EXIF data. How to do either?
In your PC's File Explorer, just click right on the image file and select “Properties / Details.” There you can see “Date Taken, a.k.a. Date Time Original.
To do that you can go to file explorer, click on documents, Click View, add column, and check “Date created” and “Date modified” both. This will show both in documents folder as well.
Use the File > Export command and export the phots as the unmodified original, if you want to keep the original file creation date. If you export an edited version Photos will render a new file with the adjustments applied, and this new file will have a new a new creation date.
According to exiftool man page 'Renaming examples'
exiftool '-Directory<DateTimeOriginal' -d %Y/%m/%d "$dir"
and if only copying is required, there is an option:
exiftool -o . '-Directory<DateTimeOriginal' -d %Y/%m/%d "$dir"
has the same effect as above except files are copied instead of moved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With