Hi
I'm trying to transfer datas from 3,000.json files to 3,000 image files (Google Photo Takeout) by using exiftool with this command
exiftool.exe -r -d %s -tagsfromfile "%d/%F.json" "-GPSAltitude<GeoDataAltitude" "-GPSLatitude<GeoDataLatitude" "-GPSLatitudeRef<GeoDataLatitude" "-GPSLongitude<GeoDataLongitude" "-GPSLongitudeRef<GeoDataLongitude" "-Keywords<Tags" "-Subject<Tags" "-Caption-Abstract<Description" "-ImageDescription<Description" "-DateTimeOriginal<PhotoTakenTimeTimestamp" -ext "*" -overwrite_original -progress --ext json D:\Program.portable\exiftool-12.27\Newfolder
After That, I got the Error massage.
Error: Not a valid PNG (looks more like a JPEG)
How to bypass/ignore or fix it ?
Thank you
The error tells you what the problem is. It has a .PNG extension but the file is a jpeg and should have a .JPG extension. Rename it.
Quote from: StarGeek on June 20, 2021, 12:17:22 PM
The error tells you what the problem is. It has a .PNG extension but the file is a jpeg and should have a .JPG extension. Rename it.
Oh I can not rename all of files bacuse there are 3,000 image files.
Do you have easy way to rename all ?
exiftool -ext png "-filename<%f.$fileTypeExtension" /path/to/files/
This will check all PNG files and rename them if they need to be renamed.
Just a quick update - I found the above command failing under Linux. Changed it to:
exiftool -ext 'png' '-FileName<%f.$FileTypeExtension' [path]
and it worked
Yes, the fact that you need to put single quotes around anything with a dollar sign on Mac/Linux has been mentioned (*checks stats*) 23,486 times in these forums. Every time that Phil posts an answer. This is due to the differences between Windows CMD and Mac/Linux command lines.