Generate XMP sidecars from CSV multiple entries

Started by gmsmurf, May 09, 2019, 05:44:57 AM

Previous topic - Next topic

gmsmurf

Hi all,

I've been using Exiftool basic commands for sometime now in my workflow.
I generate with an EXCEL macro all my metadata into CSV file with the correct structure that Exiftool expects to find and then run the following command to load the metadata into the filenames that correspond with them in the same folder.
exiftool -csv=name.csv .
All works like a charm!

Question:
Can Exiftool, generate multiple XMP sidecars according to the data it will read from the same CSV file? (or even if i have to alter the csv file for different filenames with XMP ending.

I dont want Exiftool to read image files and generate XMP's rather read one main CSV file that has all the entries and then generate for each entry an individual XMP sidecar.

The CSV structure is like this:
SourceFile XMP-dc:Title XMP-exif:Usercomment LensInfo LensMake LensModel ApertureValue IPTC:Keywords XMP-exif:Artist XMP-dc:Identifier XMP-dc:Language XMP-dc:Description XMP-dc:Publisher XMP-dc:Rights XMP-dc:Source XMP-dc:Subject XMP-dc:Format XMP-dc:Relation XMP-dc:Type


and then multiple lines under represent individual files

All best!

Phil Harvey

Quote from: gmsmurf on May 09, 2019, 05:44:57 AM
Can Exiftool, generate multiple XMP sidecars according to the data it will read from the same CSV file?

Yes.

QuoteI dont want Exiftool to read image files and generate XMP's rather read one main CSV file that has all the entries and then generate for each entry an individual XMP sidecar.

Yes, it can do this.

But without more details I can't be more specific.

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

gmsmurf

Quote from: Phil Harvey on May 09, 2019, 07:09:43 AM

But without more details I can't be more specific.

- Phil

hello Phil, and thanks for the reply. What details can I provide?

-My excel macro generates CSV files for a specific object that is being imaged.
-Each object being imaged has a unique CSV file.
-Each CSV file has multiple entries (rows) that are identical to each other, with the only difference the SourceFile and XMP-dc:Title
-In the SourceFile the macro generates the exact same filename that the imaging procedures generates. Example: the sourcefile is aaa_1.tiff the csv macro will generate a row for aaa_1.tiff
-All metadata are the same throughout a unique csv file as they describe the same object

Example of CSV file for a unique object:
SourceFile XMP-dc:Title XMP-exif:Usercomment LensInfo LensMake LensModel ApertureValue IPTC:Keywords XMP-exif:Artist XMP-dc:Identifier XMP-dc:Language XMP-dc:Description XMP-dc:Publisher XMP-dc:Rights XMP-dc:Source XMP-dc:Subject XMP-dc:Format XMP-dc:Relation XMP-dc:Type
aaa_aaa0222_a_1.tif aaa 222 Outside APO-DIGITAR Schneider APO-DIGITAR 90/4.8 SES 11 Keywords Names aaa 222 | aaa0222 English Statement of resposibility The Publisher Copyrights aaa 222 The subject Format of object aaa 222 Digital Image
aaa_aaa0222_a_1a.tif aaa 222 Outside APO-DIGITAR Schneider APO-DIGITAR 90/4.8 SES 11 Keywords Names aaa 222 | aaa0222 English Statement of resposibility The Publisher Copyrights aaa 222 The subject Format of object aaa 222 Digital Image
aaa_aaa0222_b_000.tif aaa 222 Inside APO-DIGITAR Schneider APO-DIGITAR 90/4.8 SES 11 Keywords Names aaa 222 | aaa0222 English Statement of resposibility The Publisher Copyrights aaa 222 The subject Format of object aaa 222 Digital Image
aaa_aaa0222_b_000a.tif aaa 222 Inside APO-DIGITAR Schneider APO-DIGITAR 90/4.8 SES 11 Keywords Names aaa 222 | aaa0222 English Statement of resposibility The Publisher Copyrights aaa 222 The subject Format of object aaa 222 Digital Image


What I am doing so far is to embed the above into the actual tiff files that have no metadata using the command:
exiftool -csv=a.csv . (naming the a.csv to whatever the object name is, and placing it into the same folder of the tiffs, and then deleting all the original files that have no metadata)

But I would like to know if I could instead generate XMP sidecars, even before I capture the TIFFS so that I can feed them into the capturing software I use, thus saving one step into my workflow.

I hope that the above make some sense.
All the best!

Phil Harvey

OK.  I think I understand now.

To do this, first you need to do 3 things:

1) Change the extension of the SourceFile entries in your CSV from "tif" to "xmp".

2) Change the CSV file format to be comma delimited instead of using tabs.

3) Create a text file with just the first column of the CSV, and without the "SourceFile" heading.

then run this command:

exiftool -csv=name.csv -@ files.txt

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

gmsmurf

Quote from: Phil Harvey on May 09, 2019, 09:30:58 AM
OK.  I think I understand now.

To do this, first you need to do 3 things:

1) Change the extension of the SourceFile entries in your CSV from "tif" to "xmp".

2) Change the CSV file format to be comma delimited instead of using tabs.

3) Create a text file with just the first column of the CSV, and without the "SourceFile" heading.

then run this command:

exiftool -csv=name.csv -@ files.txt

- Phil

Phil, amazing! It works perfectly!

The only bug I saw is that for some reason it turned the ApertureValue from 11 to something else:


<rdf:Description rdf:about=''
  xmlns:exif='http://ns.adobe.com/exif/1.0/'>
  <exif:ApertureValue>16799/2428</exif:ApertureValue>
</rdf:Description>


Again thank you!

Phil Harvey

The XMP:ApertureValue is stored as an APEX rational.  The stored value of 16799/2428 is correct, and corresponds to an F-number of 11 (APEX value of 6.91886).

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

gmsmurf

Quote from: Phil Harvey on May 09, 2019, 09:42:51 AM
The XMP:ApertureValue is stored as an APEX rational.  The stored value of 16799/2428 is correct, and corresponds to an F-number of 11 (APEX value of 6.91886).

- Phil

Here is something I didn't know! (on the huge list of things i don't know)

Thank you!