Hi,
I've been attempting to update IPTC data using Exiftool, and I get the following error from my code:-
String too short (minlen is 3) for IPTC:Country-PrimaryLocationCode
When I look at the Exiftool docs, it's pretty clear that this requires an ISO-3166 3 character country code, and the problem is occurring because I attempted to insert a 2 character code. All that makes sense, but the latest version of the IPTC spec here https://www.iptc.org/std/photometadata/specification/IPTC-PhotoMetadata-201007_1.pdf (https://www.iptc.org/std/photometadata/specification/IPTC-PhotoMetadata-201007_1.pdf) claims on page 46 that 2 character codes should be acceptable:-
Name | Country ISO-Code {location detail} | | |
Definition | The ISO code of a country of a location. This element is at the second level of a top-down geographical hierarchy. | | |
Photo Definition | The ISO code of a country of a location. This element is at the second level of a top-down geographical hierarchy. | | |
Photo Help Text | Enter the 2 or 3 letter ISO 3166 Country Code of the Country | | |
User Note(s) | | | |
Implementation Note(s) | | | |
Field label/title | (Location detail:) Country ISO-Code | | |
Cardinality | 0..1 | Basic data type | CV-code |
Required CV | ISO 3166-1 - 2 or 3 characters (see Definition) | | |
Spec change history | Specs (201007): XMP ValueType corrected | | |
I can obviously fix my code by making it conform to ISO-3166 3 character codes, but it seems that Exiftool should allow setting of either 2 or 3 character country codes.
Mike