ExifTool Forum

ExifTool => Developers => Topic started by: herb on May 16, 2020, 06:54:20 AM

Title: Question to empty list-elements
Post by: herb 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)
exiftool.exe -sep  ! -IPTC:By-line=List1,Elem1!!List2Elem1 test.jpg
will create a list with 3 elements for this non-structure tag and element 2 is empty (=has length 0)
(2)
exiftool.exe -sep  ! -XMP-eixm:XMPEixmListD4=[{A4List=[List1|,Elem1,,List2Elem1]}] test.jpg
will 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 
Title: Re: Question to empty list-elements
Post by: herb on May 28, 2020, 10:54:49 AM
Hello Phil,

please tell me your opinion about this behaviour.

Thanks in advance
herb
Title: Re: Question to empty list-elements
Post by: Phil Harvey 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.
Title: Re: Question to empty list-elements
Post by: Phil Harvey 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
Title: Re: Question to empty list-elements
Post by: Phil Harvey 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
Title: Re: Question to empty list-elements
Post by: herb 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. -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)  A4List=[List1Elem1,,List2Elem1,]
creates only 3 elements.

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

Thanks again and
Best regards
herb
Title: Re: Question to empty list-elements
Post by: Phil Harvey on June 22, 2020, 08:10:01 PM
Quote from: herb on June 19, 2020, 10:55:13 AM
(2) Doing the same with a listtype tag inside a structure - e.g. (see my example in first post)  A4List=[List1Elem1,,List2Elem1,]
creates only 3 elements.

OK, thanks.  I'll look into this.

- Phil