Main Menu

Writing multiple authors

Started by ozbigben, January 04, 2012, 11:29:40 PM

Previous topic - Next topic

ozbigben

Finally getting some interest in writing metadata across our institution so my project has been revitalised.  The only thing I'm still trying to sort out is how best to write multiple authors correctly to files.  The names are mainly coming from a library catalogue and almost always contain commas, the catch being that a comma will split the name into multiple authors in the XMP authors (seq container).  To prevent this I can enclose the author name with double quotes, but doing this displays 2 sets of double quotes in the basic document properties (attached screengrab for a PDF document in Acrobat).

I tried using a semicolon as a separator but without the quotes around the names the comma still gets used as a separator as well.  I'm using an arg file something like this:


-e
-sep
;
-creator="surname1, firstname1";"surname2, firstname2"


The -e is required because I've converted hex codes for diacritics to html entities... added here just in case, but possibly not relevant.

I had tried to script rearranging the author names to get rid of the commas but the variation in the data is quite scary.  If anyone has any suggestions for a better way of handling multiple authors I'm open to suggestions.

BogdanH

Hi,

You should be aware, that -sep options is just for ExifTool and that another software which might be used for vieweing metadata, doesn't know what separator you've used. Most software uses colon (or semicolon) as default -so using such characters inside seq. tags isn't that good idea.

Bogdan

ozbigben

The seq. gets written correctly, and you get the same result using this as:


-creator="surname1, firstname1"
-creator+="surname2, firstname2"


If you take out the quotes (with this or my first example) the basic author field only has single quotes around the names but the seq. container ends up with 4 entries, using the commas as separators as well.  I use the same method for keywords but that works as expected.  It only seems to happen with author.

ozbigben

Had a bit more of a play and this seems to be a quirk of Acrobat (or Adobe's XMP panels) rather than anything to do with EXIFTool. Opened the PDF in a text editor and there are only single quotes in the metadata appended at the end of the file.  If you edit the basic metadata in Acrobat to remove 2 of the 3  quotes around the names it breaks the seq. container (splitting the names by commas again).

Phil Harvey

List items should not be quoted.  The proper way do do this (in an ARGFILE) is:

-creator=surname1, firstname1
-creator=surname2, firstname2


But from the command line the quotes should be used since the argument contains spaces.  The command parser will strip them off before passing the argument to exiftool.

If you use += then creator values already in the file will be preserved, which may not be what you intended.

Without +=, existing values in the original file are overwritten.

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

ozbigben

Thanks.  I did a bit more testing and the "problem" I was having is definitely a result of the inconsistent way Adobe apps display the embedded metadata.  Acrobat appears to use the comma as an additional separator, further splitting the list values in a PDF while Photoshop correctly displays the list values for the same document.  I'll have to keep this in mind if I come across anything other quirks.

I'm using an argfile to write the metadata and as far as I can tell the two methods I've tried (without quotes) are essentially the same.

ie.

-sep
;
-creator=surname1, firstname1;surname2, firstname2


gives the same result as

-creator=surname1, firstname1
-creator=surname2, firstname2


There's no practical difference between the 2 in terms of the way I generate the list, it's just a case of changing the text I insert between the author names. The first is just a little more compact.

Ben

Phil Harvey

Hi Ben,

Yes, these 2 techniques are identical as long as no value contains a semicolon because with the 1st method the -sep option exiftool splits the input argument at the semicolon and writes individual values exactly like the 2nd method.

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

ozbigben

Our starting metadata is marc21 so I have a whole bunch of cleanup scripts stripping out manually added separators within subfields. There shouldn't be any semicolons left (and if there are, they shouldn't be there) but I'll add an extra seek and destroy just in case.  ;)