Extracting xpcomments and xpkeywords from JPGs

Hello,

I’ve been searching and I can’t seem to find an answer on the forum.

For many years I have been adding comments and tags in windows explorer to my JPG files. These are stored in the fields xpcomments and xpkeywords fields (there is also an xptitle field but that is a duplicate of the EXIF title field). I can extract the xp fields OK using the ExifTool by Phil Harvey, but I can’t seem to get them to appear in Tropy.

Is there a way to import the xpkeywords (separated by semi-colon) directly as Tropy tags?

Any help will be much appreciated.

Many thanks,

Simon

Could you post a link to a sample file with these fields? (Unfortunately, uploading the photo here directly won’t work because the files here are optimized for the web which strips the metadata.)

If the content is stored in an Exif field then we just need to know which property the field is mapped to. By including this property in your default template you can then tell Tropy to import the values.

Hope this link works: Dropbox - P_SRP0811.JPG

I think the fields are labelled IFD0:XPComment and IFD0:XPKeywords

Here is a screenshot of the information as seen in Windows/File Explorer:

Thanks for your help.

Simon

Thanks! Those fields are indeed added as Exif tags – probably an extension by Windows?

You can already import them if you add the property to the default template, however, there is a problem in that the values use a different byte encoding than the other text values, so currently you will get a meaningless list of byte numbers instead of your text. We’ll add support for decoding these values properly for the upcoming release.

Thanks for looking at it so quickly.

How do I please add the property to the template? I’ve looked and haven’t had any luck finding the matching tags.

According to Exiftool: “The EXIF “XP” tags (XPTitle, XPComment, etc) are always stored internally as little-endian Unicode (UCS‑2), and are read and written using the specified external character set” and XP tags “are used by Windows Explorer; special characters in these values are converted to UTF-8 by default.” Hope that makes more sense to you than me :smiley:

I look forward to the update in due course.

I’ll post an update here with instructions once we have the character encoding implemented .

1 Like

As promised, here’s a quick explanation of how it works.

First, you need to add exif:xPComments and similar properties to your template. You can add these either to an item or photo template (depending on where you want the data to be attached). If you don’t use a custom template, a quick way to create one is to duplicate one of the default templates and then add the extra properties.

Then you need to set your template as the default template, because that’s the template that’s used when importing photos.

Now import your photos as usual. If there are any of the Windows Exif tags in your photo and in your template, Tropy will import them accordingly using the correct text encoding. Here’s your sample photo for instance:

Please note that this won’t work in the current release yet, but it’s in the upcoming version 1.15.