Country Code with 2 or 3 characters?

Started by Reinard, January 05, 2016, 10:02:21 AM

Previous topic - Next topic

Reinard

There are two ISO schemes for the Country Code, ALFA-2 and ALFA-3 with 2 or 3 characters resp. Until now I used ALFA-2 (we talk about 200.000 photos). But when I use ExifTool now I always have to append a SPACE. Lightroom also accepts a 2-Character-Code. So, could Exiftool so tolerant to append this SPACE by itself if there are only 2 characters?

Phil Harvey

Currently, you have 2 choices with ExifTool:

1. Pad the value to the appropriate length with whatever character(s) you desire.

2. Add the exiftool -m option to ignore the IPTC spec and write a short value.

> exiftool a.jpg -Country-PrimaryLocationCode=CA
Warning: [Minor] String too short (minlen is 3) for IPTC:Country-PrimaryLocationCode
Nothing to do.
> exiftool a.jpg -Country-PrimaryLocationCode="CA "
    1 image files updated
> exiftool a.jpg -Country-PrimaryLocationCode=CA -m
Warning: String too short for IPTC:Country-PrimaryLocationCode (written anyway)
    1 image files updated


Which choice does Lightroom make?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Quote from: Phil Harvey on January 05, 2016, 10:55:22 AM
Which choice does Lightroom make?

I tested Lightroom 4.4 and it only wrote 2 characters.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Thanks StarGeek.

So it seems the solution is to add -m to the command.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Reinard

Thanks for your help, easy and perfect.