copying tags in args-file does not work

Started by Jossie, April 17, 2014, 01:45:34 PM

Previous topic - Next topic

Jossie

Good evening,

using EXIFtoolGUI to fill in the tags I need, I also wanted to copy some of them to other tags with same / similar meaning.

The following code, however, does not create the desired tags and I do not understand why this does not work:


-IPTC:Writer-Editor < XMP-photoshop:CaptionWriter
-IPTC:Keywords < XMP-dc:Subject


The tags "XMP-photoshop:CaptionWriter" and "XMP-dc:Subject" do exist. So why are they not copied to "IPTC:Writer-Editor" rsp. "IPTC:Keywords" ?

Any hint will be very much appreciated!

Best wishes

Hermann-Josef

Phil Harvey

I don't know how to debug this in the GUI, but from the command line you could add the -v2 option to see what tags that ExifTool is trying to write.

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

Jossie

#2
Good morning Phil,

well, the strange thing is that copying tags seems to depend on the order in which these are carried out. The following example works well except for lines 9, 10 and 15:

-EXIF:DocumentName < $filename
-EXIF:Artist < IPTC:By-line
-EXIF:DateTimeOriginal < XMP-photoshop:DateCreated
-IPTC:ObjectName < XMP-dc:Title
-XMP-dc:Creator < IPTC:By-line
-IPTC:By-lineTitle < XMP-photoshop:AuthorsPosition
-XMP-dc:Description < EXIF:ImageDescription
-IPTC:Caption-Abstract < EXIF:ImageDescription
-IPTC:Writer-Editor < XMP-photoshop:CaptionWriter
-IPTC:Keywords < XMP-dc:Subject
-IPTC:CopyrightNotice < EXIF:Copyright
-IPTC:DateCreated < XMP-photoshop:DateCreated
-XMP-iptcExt:ArtworkDateCreated < XMP-photoshop:DateCreated
-XMP-iptcExt:ArtworkTitle < XMP-dc:Title
-XMP-iptcExt:ArtworkCreator < EXIF:Artist

If I then create a second args-file with just these lines, which are copies from above, and execute it

-IPTC:Writer-Editor < XMP-photoshop:CaptionWriter
-IPTC:Keywords < XMP-dc:Subject
-XMP-iptcExt:ArtworkCreator < EXIF:Artist

the three tags are copied successfully. So the code seems to be okay, but it is the sequence, in which one copies the tags, which matters.

But it must be more than just the sequence. Re-arranging the commands within the args-file does not help. It is only with the second args-file, that the tags are copied. So a work-around would be to use 2 args-files. But perhaps you have a more elegant solution to this.

Many thanks for your help and best wishes

Hermann-Josef

Phil Harvey

Hi Hermann-Josef,

There must be something else happening that we aren't seeing.  Order should not matter.  This could happen if there are inconsistent newlines at the end of the lines (ie. mixed Unix and Windows newline sequences).  I suggest re-typing the entire argfile to make sure you don't have a problem with newlines or other hidden characters.  I notice there is a space after "-IPTC:Writer-Editor < XMP-photoshop:CaptionWriter " in your post.  This could also cause problems.

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

Jossie

Hello Phil,

thanks for pointing this out! Now that you write this I recall that this had been a solution to a previous problem. So I carefully re-typed the args-file. This helped solve the issue for two tags, but not for
-IPTC:Keywords < XMP-dc:Subject

It does not help executing the args-file twice. But it works if I call a second args file containing this line. This is very strange.

Best wishes

Hermann-Josef

Phil Harvey

Hi Hermann-Josef,

I could help more if you would post your argfile.

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

Jossie

Okay, you were faster than I was. I was just going to change my last reply and include the args file  :)

Many thanks for your fast reply!

Hermann-Josef

Phil Harvey

Hi Hermann-Josef,

Your argfile overrides the Keywords assignment later in the file.  Reading the note in FAQ number 22 may clear up a potential source of confusion.

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

Jossie

#8
Good morning Phil,

thank you for the hint to FAQ #22.

Now I get also the "Subject"-tag copied to "Keywords"  :). But do I understand the "note" in FAQ22 correctly, that it is not possible to make the substitution to the "Keyword"-tag in the same args-file, since always the original value (from "Subject") is copied? This would imply that I have to make the substitution in a second args-file?

Best wishes
Hermann-Josef

Phil Harvey

Hi Hermann-Josef,

Quote from: Jossie on April 20, 2014, 04:31:36 AM
it is not possible to make the substitution to the "Keyword"-tag in the same args-file

I am trying to get you to think for yourself because it is hard for me to answer questions like this since I don't know what you are trying to do.

Are you trying to do the substitution in the value of Subject that you are copying, or do you want to do this substitution on existing Keywords for the case where Subject doesn't exist?  If the former, then do the substitution on Subject when copying.  If the latter, then do the substitution on Keywords before attempting to copy Subject.  If both, then do both.  This can be done in one command.

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

Jossie

Hi Phil,

thanks for replying even on Easter-Sunday and also for your patience with me! Your last advice brought success.

Here is what I wanted to do:

I have specified interactively in the GUI the content for tag XMP-dc:Subject, being keywords relevant for the image. Since the minus-sign has a special meaning in the GUI for tags with multiple entries like keywords it cannot be used in keywords like "test-key". Instead I use an underscore typing "test_key". In the args-file, first the underscore should be replaced by a hyphen for XMP-dc:Subject. Second, I wanted to copy the content of XMP-dc:Subject to tag IPTC:Keywords, of course in the form, where the underscores are replaced. And the following code does this for me:

-Subject <${Subject;tr/_/-/}
-IPTC:Keywords < ${Subject;tr/_/-/}

Many thanks again for your help and for making EXIFtool available.

Best wishes

Hermann-Josef

Phil Harvey

Hi Hermann-Josef,

Excellent.  Glad everything is sorted out.

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