Batch convert photos with no EXIF-DateTaken

Started by Tommes, December 30, 2020, 06:39:18 AM

Previous topic - Next topic

Tommes

Hello,

the photos of my smartphone have no EXIF-DateTaken.

I want to run a batch that:
-process files from "c:/photo"
-fetch the date from filename and write it into EXIF-DateTaken
-rename file with "filename<CreateDate"
-move the file to "c:/photo/%Y/%m/%Y%m%d_%H%M%S%%-c.%%le"

I have phrases for every single step, but don't know how to combine it.

Thanks for your help,
Tommes

StarGeek

Quote from: Tommes on December 30, 2020, 06:39:18 AM
-fetch the date from filename and write it into EXIF-DateTaken

What is the format of the filename?  If it's in some form of YEAR MONTH DAY HOUR MINUTE SECONDS (any characters in between the numbers can be ignored), then the basic command would be
exiftool "-AllDates<Filename" c:/photo

See FAQ #5, specifically the 3rd paragraph.

Quote-rename file with "filename<CreateDate"
-move the file to "c:/photo/%Y/%m/%Y%m%d_%H%M%S%%-c.%%le"

Try this to see if it does what you want
exiftool -d "c:/photo/%Y/%m/%Y%m%d_%H%M%S%%-c.%%le" "-TestName<CreateDate" c:/photo

If it looks good, change TestName to Filename
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Tommes

It looks god! Thank you.
I changed to command to my NAS-folder and hat remove "-d" what is this for?

Can I combine the two commands?


/usr/bin/exiftool "-AllDates<Filename" /volume1/photo/_IMPORT/_sonstige


/usr/bin/exiftool -d "/volume1/photo/_IMPORT/_sonstige/%Y/%m/%Y%m%d_%H%M%S%%-c.%%le" /usr/bin/exiftool -d "/volume1/photo/_IMPORT/_sonstige/%Y/%m/%Y%m%d_%H%M%S%%-c.%%le" "-Filename<CreateDate" /volume1/photo/_IMPORT/_sonstige

StarGeek

If CreateDate doesn't already exist, then not really.  You can't copy the new value as you set it.  You can use the -execute option to combine them but that won't be more than a second or two faster than running two separate commands.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Quote from: Tommes on December 30, 2020, 01:21:42 PM
Can I combine the two commands?

This is possible, but difficult because you would need to reformat the FileName yourself using the advanced formatting feature since you wouldn't be able to take advantage of the date/time formatting with -d.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).