Copy of all metadata from a SET of images file to another one

Started by audiogalaxy, July 09, 2018, 03:24:18 PM

Previous topic - Next topic

audiogalaxy

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? :-)
--
Sorry for my halting English: I'm not a natural English speaker.
On a PC / windows commandline

StarGeek

One of the examples under 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
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

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

audiogalaxy

Quote from: StarGeek on July 09, 2018, 05:32:24 PM
One of the examples under 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?
--
Sorry for my halting English: I'm not a natural English speaker.
On a PC / windows commandline

audiogalaxy

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! ;-)
--
Sorry for my halting English: I'm not a natural English speaker.
On a PC / windows commandline

Hayo Baan

Hayo Baan – Photography
Web: www.hayobaan.nl

StarGeek

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 docs.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

audiogalaxy

--
Sorry for my halting English: I'm not a natural English speaker.
On a PC / windows commandline

audiogalaxy

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 docs.

thanks
--
Sorry for my halting English: I'm not a natural English speaker.
On a PC / windows commandline

audiogalaxy

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?
--
Sorry for my halting English: I'm not a natural English speaker.
On a PC / windows commandline

Phil Harvey

First, be sure you are copying the keywords as individual list items.  (See FAQ 17).

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

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

audiogalaxy

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

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!
--
Sorry for my halting English: I'm not a natural English speaker.
On a PC / windows commandline

audiogalaxy

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

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

  • harry

  • james

  • tom

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.

:-)

--
Sorry for my halting English: I'm not a natural English speaker.
On a PC / windows commandline

Phil Harvey

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