Get "Error: Not a valid PNG" when tagsfromfile json

Started by dle001, June 20, 2021, 12:14:56 PM

Previous topic - Next topic

dle001

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

StarGeek

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.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

dle001

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 ?

StarGeek

exiftool -ext png "-filename<%f.$fileTypeExtension" /path/to/files/

This will check all PNG files and rename them if they need to be renamed.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).