One to rule them all - Big Photo Metadata Tag and Date cleanup

Started by Kugelblitz, October 24, 2018, 05:40:46 AM

Previous topic - Next topic

Kugelblitz

Hello Phil,

no worries - it is not urgent.
Thank you for your reply, looks like that code works great!

Will do a bigger test now coping about 10000 Pictures on Drive and running the command there to see that errors may occur.

Kugelblitz

Ok the big test was a success so far.

I have copied my Picture Folder from the years 1978 till 2006 (13000 Images) cause they are most likely to have the wrong date as I did not have a Digital Camera back then.

Before the command ran I had 1027 Images with obviously the wrong date - that was newer than 2007 up till 2018.
After the command ran only 457 Images were left with the wrong date. Guess I just make a list out of these files and run the command to gather the Date from the Foldername just on these files.

Here are the most common Errors and Warnings in the log:
- Warning: Some character(s) could not be encoded in Latin -
I searched the forum for the error and found this.
If you drop the -L when copying Comment to FileName, you will avoid this warning.

I did not find a solution to thees errors/warnings yet

- Ignored superfluous tag name or invalid option: -filename
- Warning: Win32::API::SetFileTime returned 87
- Warning: Malformed UTF-8 character(s) -
- Warning: Invalid CanonCameraSettings data -


"Warning: JPEG format error" and "Error: JPEG EOI marker not found" and "Error: File is empty" are showing corrupted files. Guess these Images are broken.

Phil Harvey

[quote author=Kugelblitz link=topic=9614.msg50137#msg50137 date=1541752919]
[b]- Ignored superfluous tag name or invalid option: -filename [/b]


There is a meaningless -filename argument somewhere in your command.

Quote- Warning: Win32::API::SetFileTime returned 87

I haven't seen this before, but Googling, it seems to indicate an invalid date.

Quote- Warning: Malformed UTF-8 character(s) -

Character encodings are often a problem in Windows.

Quote- Warning: Invalid CanonCameraSettings data -

This is an indication that the Canon makernotes were corrupted by editing with some other software.

Quote"Warning: JPEG format error" and "Error: JPEG EOI marker not found" and "Error: File is empty" are showing corrupted files. Guess these Images are broken.

Yup.

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

Kugelblitz

Hello Phil,

to save you some time - you can skip reading this - it is just for documentation.

I have decided to use my Mac to run the command to fix the "win32" and Character encoding issues.

The Command I used did not work in MacOS exactly as they worked in Windows.

So here is the update to use it with MacOS

exiftool -config oldest_datetime_config '-FileModifyDate<OldestDateTime' '-MDItemFSCreationDate<OldestDateTime' '-DateTimeOriginal<OldestDateTime' '-CreateDate<OldestDateTime' '-ModifyDate<OldestDateTime' '-IPTC:DateCreated<OldestDateTime' '-IPTC:DateCreated<OldestDateTime' '-IPTC:TimeCreated<OldestDateTime' -@ w-remove-tags-geolat-geolon.args -@ w-separate-tags.args -execute -addtagsfromfile @ -@ w-remove-geo-name-tags.args -common_args -ext jpg -ext png -ext tif -ext cr2 -ext dng -ext nef -ext nrw --ext mov --ext avi --ext m4v --ext mp4 --ext gif -r -overwrite_original -forcewrite=exif -m -P -v2 -iptc:codedcharacterset=utf8 '/Volumes/Stuff/Tests/Fotos/'  1>processed_files_list-2018-11-16.txt 2>error_log_2018-11-16.txt

I have attached the args to this post.