ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: audiogalaxy on July 09, 2018, 03:24:18 PM

Title: Copy of all metadata from a SET of images file to another one
Post by: audiogalaxy on July 09, 2018, 03:24:18 PM
does it exist something like:

exiftool -TagsFromFile *.JPG *.CR2

?

(I need to copy all the copiable metadata from same-name JPGs of a source directory to CR2s of target directory)

Or do I have to script some for loop? :-)
Title: Re: Copy of all metadata from a SET of images file to another one
Post by: StarGeek on July 09, 2018, 05:32:24 PM
One of the examples under Copying Examples (https://exiftool.org/exiftool_pod.html#COPYING-EXAMPLES) does the reverse (copy from jpgs to CR2), so it just has to be reversed:

exiftool -tagsfromfile %d%f.jpg -ext cr2 dir
Title: Re: Copy of all metadata from a SET of images file to another one
Post by: Phil Harvey on July 09, 2018, 08:40:33 PM
I wouldn't recommend doing this.

If the JPG file contains maker notes then they will replace the CR2 maker notes which contain potentially valuable information for the color balance of the raw image.

Instead, you should specify the exact tags that you want to copy to the CR2 by adding them to the command line.  Copying all of the XMP would be fine, so adding -xmp:all is safe.

- Phil
Title: Re: Copy of all metadata from a SET of images file to another one
Post by: audiogalaxy on July 10, 2018, 08:56:53 AM
Quote from: StarGeek on July 09, 2018, 05:32:24 PM
One of the examples under Copying Examples (https://exiftool.org/exiftool_pod.html#COPYING-EXAMPLES) does the reverse (copy from jpgs to CR2), so it just has to be reversed:

exiftool -tagsfromfile %d%f.jpg -ext cr2 dir

1) thanks!
2) is that f and d a "dos" feature or a exiftool one?
Title: Re: Copy of all metadata from a SET of images file to another one
Post by: audiogalaxy on July 10, 2018, 08:57:25 AM
Quote from: Phil Harvey on July 09, 2018, 08:40:33 PM
I wouldn't recommend doing this.

If the JPG file contains maker notes then they will replace the CR2 maker notes which contain potentially valuable information for the color balance of the raw image.

Instead, you should specify the exact tags that you want to copy to the CR2 by adding them to the command line.  Copying all of the XMP would be fine, so adding -xmp:all is safe.

- Phil

Thanks Phil, safety first! ;-)
Title: Re: Copy of all metadata from a SET of images file to another one
Post by: Hayo Baan on July 14, 2018, 04:31:55 AM
Quote from: audiogalaxy on July 10, 2018, 08:56:53 AM
2) is that f and d a "dos" feature or a exiftool one?
It's an exiftool feature :)
Title: Re: Copy of all metadata from a SET of images file to another one
Post by: StarGeek on July 14, 2018, 12:42:19 PM
Quote from: audiogalaxy on July 10, 2018, 08:56:53 AM
2) is that f and d a "dos" feature or a exiftool one?

Oops, I forgot to reply to this.  As Hayo said, exiftool feature.  You can find details under the -w option (https://exiftool.org/exiftool_pod.html#w-EXT-or-FMT--textOut) docs.
Title: Re: Copy of all metadata from a SET of images file to another one
Post by: audiogalaxy on July 25, 2018, 12:35:34 PM
Quote from: Hayo Baan on July 14, 2018, 04:31:55 AM
Quote from: audiogalaxy on July 10, 2018, 08:56:53 AM
2) is that f and d a "dos" feature or a exiftool one?
It's an exiftool feature :)

thanks
Title: Re: Copy of all metadata from a SET of images file to another one
Post by: audiogalaxy on July 25, 2018, 12:36:45 PM
Quote from: StarGeek on July 14, 2018, 12:42:19 PM
Quote from: audiogalaxy on July 10, 2018, 08:56:53 AM
2) is that f and d a "dos" feature or a exiftool one?

Oops, I forgot to reply to this.  As Hayo said, exiftool feature.  You can find details under the -w option (https://exiftool.org/exiftool_pod.html#w-EXT-or-FMT--textOut) docs.

thanks
Title: Re: Copy of all metadata from a SET of images file to another one
Post by: audiogalaxy on July 25, 2018, 12:39:28 PM
Quote from: Phil Harvey on July 09, 2018, 08:40:33 PM
I wouldn't recommend doing this.

If the JPG file contains maker notes then they will replace the CR2 maker notes which contain potentially valuable information for the color balance of the raw image.

Instead, you should specify the exact tags that you want to copy to the CR2 by adding them to the command line.  Copying all of the XMP would be fine, so adding -xmp:all is safe.

- Phil

I encountered a problem: while copying the "keywords" metatag it has been considered "too long" and automatically trimmed. But... If I use a simple copy and paste from clipboard using a GUI, it seems there are not these kind of limits... Maybe I forgot some additinal option?
Title: Re: Copy of all metadata from a SET of images file to another one
Post by: Phil Harvey on July 25, 2018, 12:42:15 PM
First, be sure you are copying the keywords as individual list items.  (See FAQ 17 (https://exiftool.org/faq.html#Q17)).

Then, if necessary you may add the -m option to get around the length limitations of the IPTC specification.

- Phil
Title: Re: Copy of all metadata from a SET of images file to another one
Post by: audiogalaxy on July 25, 2018, 06:03:20 PM
Quote from: Phil Harvey on July 25, 2018, 12:42:15 PM
First, be sure you are copying the keywords as individual list items.  (See FAQ 17 (https://exiftool.org/faq.html#Q17)).

Then, if necessary you may add the -m option to get around the length limitations of the IPTC specification.

- Phil

maybe the problem is that one in the FAQ, and even if I'm not sure of this, the keywords are not in "real" IPTC, but in XMP ; but of course I'm going to check everything, thanks!
Title: Re: Copy of all metadata from a SET of images file to another one
Post by: audiogalaxy on July 25, 2018, 07:26:01 PM
Quote from: Phil Harvey on July 25, 2018, 12:42:15 PM
First, be sure you are copying the keywords as individual list items.  (See FAQ 17 (https://exiftool.org/faq.html#Q17)).

Then, if necessary you may add the -m option to get around the length limitations of the IPTC specification.

- Phil

Hallo Phil, I've carefully read the Q17 but ... I can't know what the keywords are and copy them as individual items... (or maybe I can't understand what it means: I've undeerstood this: keywords are not an unique tag but a list tag, and the real keywords are single items inside this unique tag ).

say I have a FILE_A.JPG with keywords containing this list

And the target file is FILE_B.JPG with an empty or whoknows keywords tag content, that could (and should) be overwritten with the source content.

But I don't know nothing, my script does know nothing. The task is "copy the whole block of keywords from A to B".

I think I have to use something like this:

exiftool -tagsgromfile -m FILE_A.JPG FILE_B.JPG

am I wrong?

Also consider this: I am doing this with many types of files, with, in some ways, always the "keywords" concept in: CR2, TIF, JPG, MOV, MP4 ... they could be original EXIF, IPTC ... but more and more often they are (or became) XMP.

I know that this seems to make no sense: I use Adobe Bridge to manually assign keywords to files: every future conversion automatically copies meta-informations from original to converted file.
Say I start with CR2, then convert in TIFF, then save in JPG.
CR2 info are stored in XMP "sidecar" file ...

MOV doesn't use IPTC but XMP ... and this happens with MP4.
But when I input these info, they are simply called "keywords". Using exiftool now I know that they are in some or in some other groups, actually.

Sometimes I have to copy from JPG to TIFF or from CR2 to JPG or the inverse.

Lately I had to copy MOV from MOV ... and the problem jumped out.

I've also tried the  XMP:all option but this caused an error ... so I had to choose the "no safety" option.

:-)

Title: Re: Copy of all metadata from a SET of images file to another one
Post by: Phil Harvey on July 26, 2018, 09:35:16 PM
In XMP, keywords are stored in the "Subject" tag, so a command to copy these from one file to another would be:

exiftool -tagsfromfile SOURCEFILE -subject DESTINATIONFILE

This will copy the keywords as individual items.

- Phil