-Sep Option Ineffective When Writing PDF List Fields

Started by JRocchio, August 15, 2023, 01:57:44 PM

Previous topic - Next topic

JRocchio

In trying to grok list fields and the -Sep option, which has included studying faq#17, reading several forum posts, and performing lots of my own experiments I think I have it.

BUT I do wish to confirm what I think I have uncovered as one oddity related to [PDF] fields.

Using This Custom Config --
%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::pdfx' => {
        Books => { List => 'string' },
        Album => { List => 'string' },
    },
    'Image::ExifTool::PDF::Info' => {
        Books => { List => 'string' },
        Album => { List => 'string' },
    },
);
1;  #end

With This Arguments File --
-Sep
; |<-note that there is one blank space here.
-Title=210 TEST Score F – List Fields
-Album=Album 1, Album 2; Album 3
-Books=Book Title 1
-overwrite_original
210_TEST_Score_F_ListFields.pdf

Gives Me This Result --
exiftool -a -G0 -Sep "##" 210_TEST_Score_F_ListFields.pdf
....
[PDF]           Album                           : Album 1##Album 2; Album 3
[PDF]           Books                           : Book##Title##1
[XMP]           Album                           : Album 1, Album 2## Album 3
[XMP]           Books                           : Book Title 1

My Observations and Conclusions:

   1. The -Sep option is ineffective for writing [PDF] tags. Those tags will only, and always, separate list items using a comma, or if no comma is present in the string presented for writing, then blank spaces will be used to parse the string into separate items.
   
   2. The -Sep option is effective for displaying [PDF] tags.
   
If I am missing anything, please advise!

StarGeek

See this thread.

Specifically, this post
Quote from: Phil Harvey on June 26, 2023, 01:33:49 PMThis is an unfortunate result of the lack of consistency in the PDF list format.  Sometimes lists are stored as space-delimited words, and sometimes comma-delimited.
* 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).

Phil Harvey

The -sep option is the separator used for input/output, not the one used for storage.

I've updated 12.65 to use semicolons for storage if an item contains a comma.

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