Author Topic: Using 2 Character ISO Country Codes  (Read 9544 times)

Offline David Roth

  • Member
  • **
  • Posts: 86
    • View Profile
Using 2 Character ISO Country Codes
« on: October 29, 2014, 01:45:45 PM »
I edited the list of country codes to add two character codes, but when I try to apply the code with the stationery pad or edit an individual image, nothing is applied. I am using PM 5.0 build 15807 under Windows 7. E.g., I've deleted ZAF and added ZA to the country code list without any issues. ZA appears as a selectable item in the list, but cannot be applied.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24731
    • View Profile
    • Camera Bits, Inc.
Re: Using 2 Character ISO Country Codes
« Reply #1 on: October 29, 2014, 02:33:39 PM »
David,

I edited the list of country codes to add two character codes, but when I try to apply the code with the stationery pad or edit an individual image, nothing is applied. I am using PM 5.0 build 15807 under Windows 7. E.g., I've deleted ZAF and added ZA to the country code list without any issues. ZA appears as a selectable item in the list, but cannot be applied.

I just tried it on a development version of PM 5 on Windows 7x64 and I was able to add "ZA" and apply it to a JPEG.  I then deleted the field, went back to the IPTC Stationery Pad, removed "ZAF" from the list, and applied "ZA" again and it worked fine for me.

We haven't made any changes to the IPTC Stationery Pad in quite a while so I don't know what would cause that to happen for you.  You did have the 'apply' checkbox preceding the Country code field checked, right?

-Kirk

Offline David Roth

  • Member
  • **
  • Posts: 86
    • View Profile
Re: Using 2 Character ISO Country Codes
« Reply #2 on: October 30, 2014, 04:29:59 AM »
I'm fairly certain that the apply box was checked because it worked when I applied "ZAF" after being unsuccessful with "ZA". Also, the apply box does not appear when updating a single image and clicking OK using the "I" icon. It failed this way as well.

I tried doing a find and replace on "ZAF"; replacing it with "ZA". It found all the occurrences selected, but replaced it with a blank field. I did a search for "ZA" on the same selection (now blank) just in case the letters were hidden, but came up with no hits. It appears to only accept the three character codes even though that code was removed from the list. (This applies to NAM/NA and ZWE/ZE as well. The other codes I am trying to replace.) I can try to import a new code list, but I am not sure how to delete the old one or format the new text file.

Dave Roth

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24731
    • View Profile
    • Camera Bits, Inc.
Re: Using 2 Character ISO Country Codes
« Reply #3 on: October 30, 2014, 08:45:31 AM »
David,

That's really odd behavior.  I'll have to add some logging code to the area of PM that is responsible and we'll see what's going on.

-Kirk

Offline David Roth

  • Member
  • **
  • Posts: 86
    • View Profile
Re: Using 2 Character ISO Country Codes
« Reply #4 on: October 30, 2014, 04:53:03 PM »
Some additional information: I can add any three character code even if it is not on the list. I also preceded and succeeded the two character code with a space and both were accepted. A four character code was rejected. It appears that the software is looking for a three character entry and replacing it with a blank if it does not meet that criterion.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24731
    • View Profile
    • Camera Bits, Inc.
Re: Using 2 Character ISO Country Codes
« Reply #5 on: October 30, 2014, 05:32:47 PM »
Some additional information: I can add any three character code even if it is not on the list. I also preceded and succeeded the two character code with a space and both were accepted. A four character code was rejected. It appears that the software is looking for a three character entry and replacing it with a blank if it does not meet that criterion.

Except that it is working just fine for me.  Are there any other applications involved in this process?  These are images straight out of the camera?

-Kirk

Offline David Roth

  • Member
  • **
  • Posts: 86
    • View Profile
Re: Using 2 Character ISO Country Codes
« Reply #6 on: October 31, 2014, 04:24:27 AM »
For these images I used the ingest function direct from the SD card reader and applied the photographer and event fields during ingest with the stationery pad. I also went back to some images that were dragged and dropped into the computer last year. They exhibited the same behavior and, in fact, that is where I discovered that there had to be three and only three characters. Let me know if there is anything else you could use to help diagnose this. I am going to try importing a list of 2 character codes and see if that works.

Dave Roth

Offline David Roth

  • Member
  • **
  • Posts: 86
    • View Profile
Re: Using 2 Character ISO Country Codes
« Reply #7 on: October 31, 2014, 04:42:01 AM »
How do I clear the list of three character codes without deleting them one at a time? I imported the two character codes but that just added them to the list rather than replacing it. Regardless, the imported two character codes could not be applied and resulted in a blank after being saved.

Dave Roth

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24731
    • View Profile
    • Camera Bits, Inc.
Re: Using 2 Character ISO Country Codes
« Reply #8 on: October 31, 2014, 06:50:28 AM »
Dave,

How do I clear the list of three character codes without deleting them one at a time? I imported the two character codes but that just added them to the list rather than replacing it. Regardless, the imported two character codes could not be applied and resulted in a blank after being saved.

Shift-click-select all of the items (click the first entry, scroll down to the bottom of the list, hold down the Shift key and click the last entry) and you should now have them all selected.  Delete them.  Now import your two character list.

I don't think it will make any difference to the outcome.  Investigation on my end still needs to be done.

-Kirk

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24731
    • View Profile
    • Camera Bits, Inc.
Re: Using 2 Character ISO Country Codes
« Reply #9 on: October 31, 2014, 10:28:18 AM »
David,

I have gone through all of the code and in regards to the ISO Country Code, there is nothing that checks to see if the length of the field is anything other than zero (which is used to determine if the field is empty.)

At this point I'd like to see:

1) A JPEG screen shot of your IPTC/XMP preferences
2) A JPEG screen shot of your IPTC Info dialog showing the field you're entering your two letter codes into.
3) A sample file that I can use to try and reproduce the problem.

Thanks,

-Kirk

Offline David Roth

  • Member
  • **
  • Posts: 86
    • View Profile
Re: Using 2 Character ISO Country Codes
« Reply #10 on: October 31, 2014, 11:48:35 AM »
Per your request JPEGs attached.

Dave Roth

[attachment deleted by admin]

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24731
    • View Profile
    • Camera Bits, Inc.
Re: Using 2 Character ISO Country Codes
« Reply #11 on: October 31, 2014, 01:05:16 PM »
David,

Thanks for the settings and samples.  If you change your settings to read XMP before reading IPTC on JPEGs, does this solve your problem?

-Kirk

Offline David Roth

  • Member
  • **
  • Posts: 86
    • View Profile
Re: Using 2 Character ISO Country Codes
« Reply #12 on: November 01, 2014, 06:07:29 AM »
Yes! I was able to change to a two character code from the info panel and by performing a find and replace. From reading the user manual I don't think this setting will impact me. The only other software I use is Corel Paintshop Pro X6 and sometimes Picasa 3 - both relatively new. A bug or "intended" behavior?

Thanks.

Dave Roth

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24731
    • View Profile
    • Camera Bits, Inc.
Re: Using 2 Character ISO Country Codes
« Reply #13 on: November 01, 2014, 06:44:50 AM »
David,

I'd have to look at the code more closely, but I think the problem is that IPTC (the old metadata standard) doesn't support that field and it only exists in XMP.

-Kirk