ExifTool Forum

General => Metadata => Topic started by: IanMcP on December 01, 2015, 03:13:06 AM

Title: Dynamic format of Tag depending on number of items
Post by: IanMcP on December 01, 2015, 03:13:06 AM
Hi,

I am writing user-specifiied tags from a custom config file into Adobe Illustrator files as part of a workflow.

Some tags have already been defined as Bag / List format i.e.

geography => { List => 'Bag' }

I have been asked if any field could be flat structure if only one item exists or List structure if multiple items exist.

I realise:
• The difference is academic when reading the metadata back in, if a single item is in a list
• The structure of the tag has to be set up-front in the Config file
• It adds complexity to the script handling the inputs and writing of the metadata

Is the only option to alter the Config file depending on the inputs? Is there an alternative format for the tag or a way of writing the data that will allow the structure to adapt?

Thanks for your help

Ian

Title: Re: Dynamic format of Tag depending on number of items
Post by: Hayo Baan on December 05, 2015, 06:39:39 AM
Phil might have to get back on this (he is away for a coup,e of days), but I don't think this is possible. Something is either a collection or a single item. Not both, depending on its content.

What are you trying to achieve by this anyway? Perhaps there is a different solution for your issue.
Title: Re: Dynamic format of Tag depending on number of items
Post by: IanMcP on December 06, 2015, 05:07:50 AM
The artwork file that the workflow is processing could be the artwork for a single item or it could be a family shot or line-up of several products.

In the case of 1 product, the metadata would be:
<nameSpace:barcode>0000000000000</nameSpace:barcode>

In the case of multiple products it would be:
<nameSpace:barcode>
   <rdf:Bag>
    <rdf:li>0000000000000</rdf:li>
    <rdf:li>0000000000001</rdf:li>
   </rdf:Bag>
  </nameSpace:barcode>


Thanks
Title: Re: Dynamic format of Tag depending on number of items
Post by: Phil Harvey on December 10, 2015, 07:50:25 AM
I don't think it would be proper XMP if you changed the storage format based on the number of items.  If there is only one item with a possibility of more, it should still be stored in a Bag.  I think it would be wrong to do otherwise, and ExifTool wouldn't support this.

- Phil
Title: Re: Dynamic format of Tag depending on number of items
Post by: IanMcP on December 10, 2015, 11:33:08 AM
Thanks for the definitive answer, Phil. I don't think the person writing the spec was the one having to deal with both scenarios on the client side!
We will go with List item if there is a possibility of being more than one

Cheers

Ian