Author Topic: Question to empty list-elements  (Read 337 times)

herb

  • ExifTool Freak
  • *****
  • Posts: 334
Question to empty list-elements
« on: May 16, 2020, 06:54:20 AM »
Hello Phil,

in autumn 2019 we had some discussions about empty elements of listtype tags: e.g.: https://exiftool.org/forum/index.php?topic=10513.msg55690
As far as I remember you did some enhancements that this will be possible.
Thanks again for this feature.

Now I did some regressiontests of my application and I have seen that
(1)
Code: [Select]
exiftool.exe -sep  ! -IPTC:By-line=List1,Elem1!!List2Elem1 test.jpgwill create a list with 3 elements for this non-structure tag and element 2 is empty (=has length 0)
(2)
Code: [Select]
exiftool.exe -sep  ! -XMP-eixm:XMPEixmListD4=[{A4List=[List1|,Elem1,,List2Elem1]}] test.jpgwill create only a list with 2 elements for object A4List of my defined structure list XMPEixmListD4. See attached file.
I have also checked this with an editor.

Now I am not sure whether this is correct?

Thanks for your help in advance
Best regards
herb 

herb

  • ExifTool Freak
  • *****
  • Posts: 334
Re: Question to empty list-elements
« Reply #1 on: May 28, 2020, 10:54:49 AM »
Hello Phil,

please tell me your opinion about this behaviour.

Thanks in advance
herb

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16519
    • ExifTool Home Page
Re: Question to empty list-elements
« Reply #2 on: May 28, 2020, 11:10:03 AM »
I haven't forgotten about this.

We've finally got some bad weather so I am getting a chance to catch up on things.  I should be able to get to this soon.

- Phil

Edit:  OK, it may be a few more days still.  This will take me some time to work through in detail.
« Last Edit: May 29, 2020, 04:29:21 PM by Phil Harvey »
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16519
    • ExifTool Home Page
Re: Question to empty list-elements
« Reply #3 on: June 02, 2020, 03:13:22 PM »
Finally I got a chance to look into this in detail.  I think I can have this fixed for 12.00 so that the blank list item is inserted.  This is a bit tricky because there are cases where the blank should not be inserted (eg. in a list of lang-alt tags when writing a specific language to only specific list items).  But I should be able to resolve this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16519
    • ExifTool Home Page
Re: Question to empty list-elements
« Reply #4 on: June 03, 2020, 09:04:05 AM »
Hmmm.  There are some cases where I don't want to add empty tag values in lang-alt lists (eg. XMP tests 35 and  38 in the standard ExifTool test suite), and there are other times where I do.  This may need some more work in the future, but for now I'll only allow empty elements to be added in the last branch for nested lists.  This will keep the same behaviour for the test suite, while fixing the behaviour you observed.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

herb

  • ExifTool Freak
  • *****
  • Posts: 334
Re: Question to empty list-elements
« Reply #5 on: June 19, 2020, 10:55:13 AM »
Hello Phil,

thanks for the new version of Exiftool and thanks for the corrections and enhancements.

Starting to play around with the new version I have one observation:
(1) Writing a listtype tag which is not inside a structure -  e.g.
Code: [Select]
-IPTC-By-line=elem1,,elem3,creates 4 elements with elements 2 and 4 empty.

(2) Doing the same with a listtype tag inside a structure - e.g. (see my example in first post) 
Code: [Select]
A4List=[List1Elem1,,List2Elem1,]creates only 3 elements.

For me
Quote
I'll only allow empty elements to be added in the last branch for nested lists
is very good.

Thanks again and
Best regards
herb

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16519
    • ExifTool Home Page
Re: Question to empty list-elements
« Reply #6 on: June 22, 2020, 08:10:01 PM »
(2) Doing the same with a listtype tag inside a structure - e.g. (see my example in first post) 
Code: [Select]
A4List=[List1Elem1,,List2Elem1,]creates only 3 elements.

OK, thanks.  I'll look into this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).