How to pass an array when I writing a tag using command line

Started by mordom, May 08, 2021, 01:42:56 PM

Previous topic - Next topic

mordom

Hello there,

I am developing a software using nodejs, it calls exiftool through the command line in the background.
I want to write a specific tag using command-line. The value of the tag is an Array. I tried this as followed and got unexpected results.

Input: E:\exiftool\exiftool.exe '-xmp:ToneCurvePV2012=["0, 0", "111, 156", "255, 255"]' D:\test\test.dng

It runs successfully, but when I read this tag(with -j option)  after that, I got a type of String value like "["0, 0", "111, 156", "255, 255"]", not an Array.
So how to write a value whitch type is Array, not String? Or how to pass an array value to the command-line?

I wrote this text with help of a translation software, hope I clearly stated what I mean.
Thanks for your time.

StarGeek

Quote from: mordom on May 08, 2021, 01:42:56 PMThe value of the tag is an Array.

In exiftool, this is a List type tag.  If you look at the entry for ToneCurvePV2012 under the XMP-crd group, you'll see it has a + after it, indicating it as such.

See FAQ #17 for details on how to write to list type tags.

QuoteInput: E:\exiftool\exiftool.exe '-xmp:ToneCurvePV2012=["0, 0", "111, 156", "255, 255"]' D:\test\test.dng

You would want to run something like this using the -sep option
exfitool -Sep ',' '-xmp:ToneCurvePV2012=0,0,111,156,255,255' D:\test\test.dng
or individually
exfitool '-xmp:ToneCurvePV2012=0' '-xmp:ToneCurvePV2012=0' '-xmp:ToneCurvePV2012=111' '-xmp:ToneCurvePV2012=156' '-xmp:ToneCurvePV2012=255' '-xmp:ToneCurvePV2012=255' D:\test\test.dng
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).