ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: José Oliver-Didier on March 09, 2022, 07:45:07 PM

Title: Invalid characters added when using convert_regions.config
Post by: José Oliver-Didier on March 09, 2022, 07:45:07 PM
I am using the convert_regions.config for copying the MP WLPG or IPTC regions to MWG regions:

exiftool -config convert_regions.config "-RegionInfo<MPRegion2MWGRegion" *.jpg -overwrite_original

However, I have noticed that certain characters are intepreted differently for example "é" becomes gibrish when read by "Geosetter". I am running Windows 11 and tried changing the console charset using chcp 65001 as well as using the -L as well as -char utf8 flags in the exiftool commands to no avail. What am I doing wrong?
Title: Re: Invalid characters added when using convert_regions.config
Post by: StarGeek on March 09, 2022, 08:37:30 PM
I think that this is a Geosetter problem.

I took a test image and added a region with the é character in it.  Loaded the file into Imatch and it displayed correctly.  Listed the region with exiftool and it was correct.  Loaded the image into Geosetter and it was mojibaked (https://en.wikipedia.org/wiki/Mojibake) into é.

No problem with similar characters in other locations, as I set XMP:State to "Provence-Alpes-Côte d'Azur" and "Côte" showed up correctly.  But set the RegionName to "Côte" and it became CA'te.  Even a direct copy with "-RegionName<State" did the same thing so it isn't a problem with the config file.
Title: Re: Invalid characters added when using convert_regions.config
Post by: Phil Harvey on March 09, 2022, 08:53:25 PM
@StarGeek: Look at you with the new words! ;)   mojibaked  :P

- Phil
Title: Re: Invalid characters added when using convert_regions.config
Post by: José Oliver-Didier on March 10, 2022, 08:17:40 AM
Seems that @StarGeek is correct it may be an issue with GeoSetter.

From the XMP, the only difference I see is in how it is structured:

Exiftool (People's names are mojibaked in GeoSetter):

    <rdf:Bag>
     <rdf:li rdf:parseType='Resource'>
      <mwg-rs:Area rdf:parseType='Resource'>
       <stArea:h>0.0813492</stArea:h>
       <stArea:unit>normalized</stArea:unit>
       <stArea:w>0.0528274</stArea:w>
       <stArea:x>0.4854907</stArea:x>
       <stArea:y>0.5849866</stArea:y>
      </mwg-rs:Area>
      <mwg-rs:Name>José</mwg-rs:Name>
      <mwg-rs:Type>Face</mwg-rs:Type>
     </rdf:li>


Digikam (People's names are read correctly in GeoSetter):

<rdf:li>
<rdf:Description mwg-rs:Name="José" mwg-rs:Type="Face">
          <mwg-rs:Area stArea:x="0.485491" stArea:y="0.584987" stArea:w="0.0528274" stArea:h="0.0813492" stArea:unit="normalized"/>
         </rdf:Description>
</rdf:li>


In both instances Digikam reads the names correctly.
Title: Re: Invalid characters added when using convert_regions.config
Post by: StarGeek on March 10, 2022, 12:33:33 PM
Ok that's just very weird.

Add -api Compact=Shorthand (https://exiftool.org/ExifTool.html#Compact) and geosetter will display it correctly.

You can fix "broken" regions with
exiftool -RegionInfo= -TagsFromFile @ -RegionInfo -api Compact=Shorthand /path/to/files/

Title: Re: Invalid characters added when using convert_regions.config
Post by: José Oliver-Didier on March 10, 2022, 03:09:40 PM
After trying the shorthand conversion, it displayed correctly in Geosetter. Indeed, very weird on the part of Geosetter.

I opened a bug in Geosetter's bug tracking Mantis db. https://www.geosetter.de/mantis/view.php?id=2274

I have not seen much development going on with Geosetter, but still you never know.

Thanks again, Phill and StarGeek!
Title: Re: Invalid characters added when using convert_regions.config
Post by: StarGeek on March 11, 2022, 03:37:55 PM
Quote from: José Oliver-Didier on March 10, 2022, 03:09:40 PMI have not seen much development going on with Geosetter, but still you never know.

It looks like the only issues that are being closed are spam.  So someone's looking at it, but only to deal with the spam.