Copying all exif data to another picture

Started by ByWolly, July 01, 2023, 07:20:01 PM

Previous topic - Next topic

ByWolly

So I need to copy all the exif data from Source.jpg picture to another Target.jpg picture (also if there's any other existing exif data in Target.jpg that doesn't have Source.jpg - must be cleaned).

Also both pictures sometimes may not have any time data so I also need some command that will add necessary -timecreated and -datecreated to the Target.jpg picture based on the current time each time I run the command. Is there any comand like -timecreated="current_time" and -timecreated="current_time" so it would always be replaced with my current system time?

I tried the command:
exiftool -tagsfromfile Source.jpg -exif:all Target.jpg

But it gives me an error:
Warning: No writable tags set from Source.jpg
Thanks in advance!

StarGeek

#1
Quote from: ByWolly on July 01, 2023, 07:20:01 PMI tried the command:
exiftool -tagsfromfile Source.jpg -exif:all Target.jpg

That would be the command to use.  Are you sure there is EXIF data in the file and not some other type of data, such as IPTC or XMP?  Use the command in FAQ #3 to see all the data, their locations, and any tags with duplicated names.

Quote from: ByWolly on July 01, 2023, 07:20:01 PM(also if there's any other existing exif data in Target.jpg that doesn't have Source.jpg - must be cleaned).

To clear out only the EXIF data that already exists in Target.jpg before the copy, use
exiftool -EXIF:All= -tagsfromfile Source.jpg -exif:all Target.jpg[/quote]

To clear out all data before hand, use
exiftool -All:All= -tagsfromfile Source.jpg -exif:all Target.jpg[/quote]
* 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).

ByWolly

Quote from: StarGeek on July 01, 2023, 09:09:56 PM
Quote from: ByWolly on July 01, 2023, 07:20:01 PMI tried the command:
exiftool -tagsfromfile Source.jpg -exif:all Target.jpg

That would be the command to use.  Are you sure there is EXIF data in the file and not some other type of data, such as IPTC or XMP?  Use the command in FAQ #3 to see all the data, their locations, and any tags with duplicated names.

Quote from: ByWolly on July 01, 2023, 07:20:01 PM(also if there's any other existing exif data in Target.jpg that doesn't have Source.jpg - must be cleaned).

To clear out only the EXIF data that already exists in Target.jpg before the copy, use
exiftool -EXIF:All=-tagsfromfile Source.jpg -exif:all Target.jpg

To clear out all data before hand, use
exiftool -All:All=-tagsfromfile Source.jpg -exif:all Target.jpg[/quote]


When I use your command it just replaces all the exif tags with the word "-tagsfromfile". Are you sure there's no need for space between "-All:All=" and "-tagsfromfile"?

Also, what's the difference in writing uppercase "-EXIF:All=" and lowercase "-exif:all"?

Phil Harvey

Quote from: ByWolly on July 15, 2023, 09:05:26 PMexiftool -All:All=-tagsfromfile Source.jpg -exif:all Target.jpg

Ooops.  There needs to be a space after the "="

QuoteAlso, what's the difference in writing uppercase "-EXIF:All=" and lowercase "-exif:all"?

No difference due to the different case, but the trailing "=" will cause the tags to be deleted.

- 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 ($).

StarGeek

Quote from: Phil Harvey on July 17, 2023, 08:44:56 AMOoops.  There needs to be a space after the "="

Bah, I wonder how that slipped past me.  Fixed.
* 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).