custom-metadata icon indicating copy to clipboard operation
custom-metadata copied to clipboard

Nested properties of type Alt Lang show no value

Open nitmws opened this issue 1 year ago • 9 comments

Description All properties of type Alt Lang in a nested structure show no value. (Properties of type Text are showing values.)

Steps to reproduce

  • Install the attached view specification
  • View a test image with e.g. a fully set Artwork or Object property (using a structure as value) (e.g. the attached one)
  • Content Description, Contribution Description, Physical Description and Title show no value.

Workarounds None

Expected behavior To show a value

Screenshots None

XMP Metadata attached

Metadata View JSON attached

Environment

  • OS type and version: Windows 11
  • Extension version: latest

IPTC-PhotometadataRef-Std2023.1_XMP.zip IptcPmd20231_cupmdpnl03a.json

nitmws avatar Mar 06 '24 21:03 nitmws

We are working to support this in a later version of Custom Metadata. We did not support Language Alternatives when creating Structure support. We know this to be an omission.

You could use the direct method to get to these properties. See the IPTC Creator section of the Default View. Here, I have changed the city field (CreatorContactInfo/Iptc4xmpCore:CiAdrCity) to Language Alternative. It renders correctly.

image

With no data entered: image

With data entered: image

jameslockman avatar May 05 '24 15:05 jameslockman

We've made some adjustments that you can view in the 2.0.2 beta 1 release. Please download and see if this works for you!

jameslockman avatar Sep 14 '24 00:09 jameslockman

I've tested 2.0.2b1 with this IPTC reference image: https://iptc.org/std/photometadata/examples/IPTC-PhotometadataRef-Std2023.1.jpg ... and checked the structure of the Artwork or Object in the Image structure-property: Ccontent Description and Contribution Description are Lang Alt properties with values - but no value is shown - see my screenshot. IPTC-Artwork-ContentDescritpion-empty_2024-09-14

nitmws avatar Sep 14 '24 17:09 nitmws

Thanks for the feedback. We'll check with your new image and get a b2 out ASAP.

jameslockman avatar Sep 14 '24 18:09 jameslockman

I believe you may have added en-gb as the default language to the form, but not to the asset. The asset shows only x-default as a value.

                     <rdf:Alt>
                        <rdf:li xml:lang="x-default">AO Content Description 1 (ref2023.1)</rdf:li>
                     </rdf:Alt>
                  </Iptc4xmpExt:AOContentDescription>
                  <Iptc4xmpExt:AOContributionDescription>
                     <rdf:Alt>
                        <rdf:li xml:lang="x-default">AO Contribution Description 1 (ref2023.1)</rdf:li>
                     </rdf:Alt>
                  </Iptc4xmpExt:AOContributionDescription>
                  <Iptc4xmpExt:AOCopyrightNotice>AO Copyright Notice 1 (ref2023.1)</Iptc4xmpExt:AOCopyrightNotice>
                  <Iptc4xmpExt:AOCreator>
                     <rdf:Seq>
                        <rdf:li>AO Creator Name 1a (ref2023.1)</rdf:li>
                        <rdf:li>AO Creator Name 1b (ref2023.1)</rdf:li>
                     </rdf:Seq>
                  </Iptc4xmpExt:AOCreator>
                  <Iptc4xmpExt:AOCreatorId>
                     <rdf:Seq>
                        <rdf:li>AO Creator Id 1a (ref2023.1)</rdf:li>
                        <rdf:li>AO Creator Id 1b (ref2023.1)</rdf:li>
                     </rdf:Seq>
                  </Iptc4xmpExt:AOCreatorId>

jameslockman avatar Sep 14 '24 20:09 jameslockman

What would you expect the correct behavior to be? The spec suggests that the asset should have a value with the lang attribute set to en-gb. We can check to see if there is a value for x-default but no value for the specified default lang. If so, use the x-default value for both.

jameslockman avatar Sep 14 '24 20:09 jameslockman

What we at IPTC expect:

  • With "altLang" (in the panel specs) the languages which can be edited are specified --> three languages are specified, three fields are shown in the panel
  • In the panel specs the language can be specified which is used as source for copying its value to an "x-default" variant in the LangAlt. (If the field of this language has no value no "x-default" is set.)
  • Displaying read metadata: if only "x-default" has a value it is shown in the field of the language defined as "Default" language.

Note: the example of the AltTextAccessibility field below is very close to our expectations.

Some testing

I've tested 2.0.2b1 with a different image having LangAlt values of "x-default" and "en" as language - attached. It looks like the language attribution is a tripwire:

Tested property 1: Iptc4xmpCore:AltTextAccessibility

Its specification in the Custom Metadata Panel JSON uploaded to Bridge: { "id": "altTextAccessibility", "displayName": "Alt Text (Accessibility)", "prefix": "Iptc4xmpCore", "namespace": "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "propertyName": "AltTextAccessibility", "dependencies": [], "readOnly": false, "disabled": false, "multiLine": false, "type": "Text", "altLang": ["en-GB", "fr", "es"], "altLangDefault": "en-GB", "altLangEnabled": true },

This is the value in the image file: Iptc4xmpCore:AltTextAccessibility rdf:Alt <rdf:li xml:lang='x-default'>A small pond in front of bushes and lawn. In the middle of the pond a fountain.</rdf:li> <rdf:li xml:lang='en'>A small pond in front of bushes and lawn. In the middle of the pond a fountain.</rdf:li> </rdf:Alt> </Iptc4xmpCore:AltTextAccessibility>

This is how it is shown in the panel: IPTC-AltText-default--en

Strictly said the xml:lang="en" of the image does not meet any of the language identifiers of the panel specification.

Tested property 2: Iptc4xmpExt:ArtworkOrObject --> Iptc4xmpExt:AOContentDescription

Its specification in the Custom Metadata Panel JSON uploaded to Bridge: { "id": "artworkOrObjects-contentDescription", "displayName": "Content Description", "prefix": "Iptc4xmpExt", "namespace": "http://iptc.org/std/Iptc4xmpExt/2008-02-29/", "propertyName": "AOContentDescription", "dependencies": [], "readOnly": false, "disabled": false, "multiLine": true, "type": "Text", "altLang": ["en-GB", "fr", "es"], "altLangDefault": "en-GB", "altLangEnabled": true }, (language-wise the same as above)

This is the value in the image file: Iptc4xmpExt:AOContentDescription rdf:Alt <rdf:li xml:lang='x-default'>A rainbow next to a fountain</rdf:li> </rdf:Alt> </Iptc4xmpExt:AOContentDescription>

This is how it is shown in the panel: IPTC-AOContentDescription-noLang

This raises questions:

  1. The languages of property 1 in the file do not meet any of the languages specified for the panel. Despite of that a value is shown. (I would have to change the text values to know if "x-default" or "en-GB" is shown.) Why is a value shown?
  2. The only language of property 2 in the file is "x-default". I was assuming this is shown in the field of the Default language. "en/en-GB" - why isn't it?

Note: in Preferences -> View editor only the main languages can be set: "en" but no "en-GB" and "en-US".

This is the tested image:

iptc-pmd-example01-2023 2

nitmws avatar Sep 15 '24 17:09 nitmws

Responses to the above questions:

  1. The languages of property 1 in the file do not meet any of the languages specified for the panel. Despite of that a value is shown. (I would have to change the text values to know if "x-default" or "en-GB" is shown.) Why is a value shown?

    Answer: 8.2.2.4 Language Alternative in the XMP Spec states that

    the xml:lang value is composed of one or more parts: a primary language subtag and a (possibly empty) series of subsequent subtags. It goes on to say that: A default value, if known, should be the first array item.

    Based on this, we believe that the XMP Library returns the first item in the array when we ask for the default value.

  2. The only language of property 2 in the file is "x-default". I was assuming this is shown in the field of the Default language. "en/en-GB" - why isn't it?

    Answer: 8.2.2.4 Language Alternative in the XMP Spec also states that:

    An xml:lang value of "x-default" may be used to explicitly denote a default item. If used, the "x-default" item shall be the first in the array and its simple text value should be repeated in another item in which the xml-lang specifies its actual language. However, an "x-default" item may be the only item, in which case there is only a default value and no defined language.

    In this asset, if the asset is to be seen as the authority, then en-GB is not the default value, and we don't display anything since the default value's xml:lang is not declared on the asset itself.

    If you think it's appropriate, we can override the asset on display, if there is a defined default locale. This would not make the asset conform to the expectation of the View; rather, the user would need to update and save the asset to rewrite the array back to the asset. This would provide some leniency for improperly tagged images, but it would be making presumptions about the asset manager's intent.

jameslockman avatar Sep 15 '24 20:09 jameslockman

Thanks for pointing at the XMP ISO specs, as all the Adobe products I use (Photoshop, Bridge, Lightroom, Premiere, Illustrator, Acrobat) implement only the use of a single value with "x-default" in a Lang Alt property. So I had to re-read it now.

  • The recommendation to write a value twice with xml:lang attributes of e.g. "en" and "x-default" was not taken seriously by most software makers as Adobe products didn't support it. In fact implementations of this recommendation do not exist. I guess the Custom Metadata Panel is one of the first implementations of this feature.
  • Looking at the metadata reading and displaying case: if the Custom Metadata Panel can be enabled to support multiple languages of a Lang Alt property there must be a "nice" way to deal with properties having an "x-default" value only. Not showing makes the panel almost unusable as there are billions of image files with "x-default only" Lang Alt properties, their value would not be displayed ...
  • ... I suggest for the case-specific rules of the panel:
    • If the property is set to Lang Alt support:
    • Set "altLang" to one or more languages
    • "altLangDefault" must be set to one of these languages
    • Displaying: the "x-default" value is shown in the field with the "(Default)" mark. This field will be overwritten if e.g. "en" is in "altLang" and the "altLangDefault" and if a value with "en" exists in the read XMP: the value of the "en" value is displayed.

Aside: From earlier discussions at IPTC about the Lang Alt type I recall that this recommendation was not liked as it blows up the size of the XMP packet. This got more effect by the Accessibility properties introduced by IPTC in 2022: both should explain the content of an image by text. In particular the Extended Description suggests to write a long description - in multiple languages. If one writes a 1k long Extended Description it instantly takes 2k of the XMP packet. It would be great if the ISO group behind the XMP specs considers a "slim" variant like e.g. "x-default,en".

nitmws avatar Sep 16 '24 08:09 nitmws

Closed in https://github.com/adobe-dmeservices/custom-metadata/releases/tag/2.0.2

jameslockman avatar Nov 15 '24 19:11 jameslockman