How to first erase tags and then write into a JPEG file

Started by PersaBoy, October 08, 2022, 05:03:46 PM

Previous topic - Next topic

PersaBoy

> I've got Image.JPG
> I edit it in Photoshop and save it as Image_Edited.JPG

Now, I'd like to read the EXIF from the Image.JPG and write it into the Image_Edited.JPG?
Here is what I did:
exiftool -json /Users/dani/Desktop/Image.JPG  > outp.json
exiftool -json=outp.json Image_Edited.jpg

The problem is that it doesn't first remove all tags from Image_Edited.JPG and then write outp.json into it. Looks like it just edits the existing tags since the PhotoShop tags still remain in it!

So, how can I completely remove all the Image_Edited.JPG tags first and then write outp.json into it?

StarGeek

Why not copy directly instead of taking the extra step of  saving to a json file?

You could use
exiftool -all= -TagsFromFile /Users/dani/Desktop/Image.JPG -All:All Image_Edited.jpg

This will remove all tags from Image_Edited.jpg, then copy all tags from the original.

Otherwise, just add -All= to your command that reads from the json.
* 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).

PersaBoy

Thanks, it works but there are two issues here:

1. It also transfers the original thumbnail to the second file
2. it changes orientation of some photos.

Any advice?

Quote from: StarGeek on October 08, 2022, 06:42:53 PMWhy not copy directly instead of taking the extra step of  saving to a json file?

You could use
exiftool -all= -TagsFromFile /Users/dani/Desktop/Image.JPG -All:All Image_Edited.jpg

This will remove all tags from Image_Edited.jpg, then copy all tags from the original.

Otherwise, just add -All= to your command that reads from the json.

StarGeek

Try this, I think it will work
exiftool -all= -TagsFromFile /Users/dani/Desktop/Image.JPG -All:All -thumbnailimage= -Orientation= Image_Edited.jpg
* 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).