-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Currently calling execute_json sets only -j
as ExifTool parameter - but it does not set the -struct
parameter. That's a dangerous for metadata properties with structured values and multiple values.
Example: the IPTC Photo Metadata Standard defines a property Location Shown in the Image which has a structure of City, State/Province, Country Name, Country Code, Sublocation and more. And it may have multiple values = multiple structures.
Using the -j
(JSON) parameter without the -struct
parameter returns such a result:
"XMP:LocationShownCity": ["City (Location shown2) (ref2021.1)"],
"XMP:LocationShownCountryCode": ["ABC","ABC"],
"XMP:LocationShownCountryName": ["CountryName (Location shown1) (ref2021.1)","CountryName (Location shown2) (ref2021.1)"],
"XMP:LocationShownSublocation": ["Sublocation (Location shown1) (ref2021.1)"],
Using the -j
(JSON) parameter WITH the -struct
parameter returns such a result:
"XMP:LocationShown": [{
"CountryCode": "ABC",
"CountryName": "CountryName (Location shown1) (ref2021.1)",
"Sublocation": "Sublocation (Location shown1) (ref2021.1)"
},{
"City": "City (Location shown2) (ref2021.1)",
"CountryCode": "ABC",
"CountryName": "CountryName (Location shown2) (ref2021.1)"
}],
The essential difference: the XMP:LocationShownCity
and the XMP:LocationShownSublocation
of the result without -struct
have only a single value in the array, but knowbody knows if this is the City name or Sublocation name of the first location of of the second location. While the XMP:LocationShown has a JSON object for each location and the first object has no City but a Sublocation, the second object has a City but no Sublocation. Which location has what structured data is crystal clear.
(Note: the results above are taken from the IPTC Photo Metadata reference image, it has values telling to which property it belongs.)
With this semantic issue as background I suggest to set the -struct
parameter with the -j
parameter in the execute_json method.