How to write to LocationShownRegion

Started by grasdk, January 11, 2024, 02:45:57 PM

Previous topic - Next topic

grasdk

Hi

Using the attached file (LocationShownRegionExample.jpg), I can run this command:
exiftool -G0:1:2 -LocationShown* LocationShownRegionExample.jpg
$ exiftool -G0:1:2 -LocationShown* LocationShownRegionExample.jpg
[XMP:XMP-iptcExt:Location] Location Shown City  : test1
[XMP:XMP-iptcExt:Location] Location Shown Country Name: Sverige
[XMP:XMP-iptcExt:Author] Location Shown Region  : SkÃ¥ne
[XMP:XMP-iptcExt:Location] Location Shown Sublocation: Häglinge

I didn't use -G0:1:2 originally, but added to get more info.

How can I write "Location Shown Region"?

I am able to write the other LocationShown*-tags with no problem, just not LocationShownRegion.


What I tried:
exiftool 'LocationShownRegion=test1' LocationShownRegionExample.jpg
exiftool '-Xmp:LocationShownRegion=test1' LocationShownRegionExample.jpg
exiftool '-xmp-iptcext:locationshownregion=test2' LocationShownRegionExample.jpg

both ending up in
Warning: Tag 'LocationShownRegion' is not defined
Nothing to do.
Warning: Tag 'Xmp:LocationShownRegion' is not defined
Nothing to do.
Warning: Tag 'xmp-iptcext:locationshownregion' is not defined
Nothing to do.

Also tried the ExifToolGUIx64 under Windows, which generated these args
-echo4
{ready31}
-CHARSET
FILENAME=UTF8
-CHARSET
UTF8
-v0
-overwrite_original
-sep
*
-c
%.6f°
-API
WindowsWideFile=1

-xmp-iptcext:locationshownregion=test2
LocationShownRegionExample.jpg
-execute31
and this result
Warning: Tag 'xmp-iptcext:locationshownregion' is not defined
Nothing to do.

Tested with same results (exchanged ' with " under Windows CMD):
- Windows 10 CMD exiftool version 12.72
- Windows 10 WSL2 (ubuntu) exiftool version 12.69
- Synology alpine Linux with exiftool version 12.72 manually added (to work locally where my photo collection is, if you wonder)

If this is a bug, let me know if I must re-create this post in the bug-part of the forum.

Thank you in advance for any help.

kind regards


PS: I use the Windows release of DigiKam version 8.1.0 which shows the tag name in another way. I wasn't able to make use of it, though. I attached a screenshot to the post, in case it is of interest.



Phil Harvey

There is no LocationShown "Region" tag in the IPTC Extension schema.  It should be "WorldRegion".

- 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

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

grasdk

#3
Okay, thank you for that clarification. I had a suspicion of something like that. I wonder which of the tools I tested wrote the tag in the first place.

Do you (or anyone else reading this) have input on how to remove the tag and the value using exiftool?

Can I do a surgical strike and cut it out, or do I need to remove all and add all again (thereby leaving out non-standard stuff)?
exiftool -all= -tagsfromfile @ -all:all -IPTC:All -XMP:All -ColorSpaceTags -F LocationShownRegionExample.jpg

StarGeek

Try
exiftool -XMP-iptcExt:all= -TagsFromFile @ -XMP-iptcExt:all /path/to/files/

That will remove all XMP-iptcExt tags and then copy them back into the file. Since exiftool doesn't know about LocationShownRegion, it can't copy it back in.

Checking further, you can use this as a more directly targeted command, though it will give a warning
C:\>exiftool -G1 -a -s -XMP-iptcExt:all Y:\!temp\x\y\zz\LocationShownRegionExample.jpg
[XMP-iptcExt]   LocationShownCity               : test1
[XMP-iptcExt]   LocationShownCountryName        : Sverige
[XMP-iptcExt]   LocationShownRegion             : SkÃ¥ne
[XMP-iptcExt]   LocationShownSublocation        : Häglinge

C:\>exiftool -P -overwrite_original -LocationShown= -TagsFromFile @ -LocationShown Y:\!temp\x\y\zz\LocationShownRegionExample.jpg
Warning: 'Region' is not a field of LocationDetails - Y:/!temp/x/y/zz/LocationShownRegionExample.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -XMP-iptcExt:all Y:\!temp\x\y\zz\LocationShownRegionExample.jpg
[XMP-iptcExt]   LocationShownCity               : test1
[XMP-iptcExt]   LocationShownCountryName        : Sverige
[XMP-iptcExt]   LocationShownSublocation        : Häglinge

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

grasdk

Perfect! As always so helpful.

Thank you very much  :)

Phil Harvey

@StarGeek: Great idea to delete/restore just the LocationShow structure to remove its invalid elements.

- 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 ($).