3
\$\begingroup\$

I want to migrate from Picasa (to digiKam) and to export the face tags. I tried the experimental feature of writing faces to XMP, and noticed it changes the SHA256 hashes of the files, which I want to avoid. The version of Picasa I'm using is 3.9.141 (Build 255). Is there any solution to this? I'm using Windows, but planning to use Linux too so a universal/cross-platform approach, and my files are in JPG/JPEG, PNG, and WebP formats.

The reason I want to avoid a hash change, is that some images are downloaded from the internet and I may download them again in the future. Deduplication becomes more difficult with hash changes.

\$\endgroup\$
6
  • \$\begingroup\$ Do we talk about JPG images? \$\endgroup\$ Aug 10, 2022 at 11:55
  • 1
    \$\begingroup\$ Could you perhaps elaborate on why you want to avoid a hash change? In case of JPG files, when you write metadata, this is written into a special part of the JPG file, so as the file changes, the hash changes. Also, what software do you intend to migrate to? Please edit your question to include these details as this might change the appropriate answer. \$\endgroup\$ Aug 10, 2022 at 12:14
  • \$\begingroup\$ @RomeoNinov Yes, also PNG and WebP, although I can convert them to JPG. \$\endgroup\$
    – Sepp A
    Aug 10, 2022 at 12:48
  • \$\begingroup\$ Why do you want to avoid the hash change? \$\endgroup\$ Aug 10, 2022 at 12:51
  • 1
    \$\begingroup\$ @SeppA both the info on digikam and on deduplication are very useful, please edit your question to include that. No need to write "EDIT:" or anything like that, just integrate it into your original question. So you final goal is to have a "deduplicatable" image library with face tags exported from picasa. \$\endgroup\$ Aug 10, 2022 at 13:09

2 Answers 2

2
\$\begingroup\$

From your comments I understand you currently have an image library in Picasa, with photos which might become duplicated in the future (due to re-downloading). To ease the deduplication process you want to have a "static" hash for each photo, even when you update the metadata of the photo.
You're looking to move away from Picasa to a cross-platform solution, which digiKamoffers.

Below information is pieced together from the internet, I haven't tried anything, but from the descriptions it seems it will do what you want. Make a backup before trying anything.

Getting face tags from Picasa to digiKam

When you do a websearch for "digikam face tag import" you'll find a few methods that relate to Picasa:

  • This gist exports the face tags from Picasa to the digiKam database directly, without touching any photos.
  • picasa2digikam which is "A script to migrate Picasa metadata from its .picasa.ini files and/or contacts.xml file to the digiKam database."

Using any of the two methods above you should be able to get the face tagging out of Picasa and into digiKam.

Writing metadata, but without changing the photo file

Now you have a digiKam database that indicates the face tagging information for all your photos. From your comment it seems you don't want to be tied to any software, so you probably want to look into XMP sidecar files.

Those files live next to the photo files and hold the metadata, such as the face tags. digiKam has support for writing metadata to sidecar files:

In digiKam’s main window go to Settings -> Configure digiKam and select the tab Metadata There are four options available:

  • Write to image only — This option will not use XMP but will write all the metadata directly into the images.
  • Write to XMP sidecar only — No metadata will be written to any images directly but it will write all metadata into a separate XMP file in the same directory as the image.
  • Write to image and XMP sidecar – metadata will be written to both XMP and Image.
  • Write to XMP sidecar for Read-only images only — which means that images which have read, write and execute permissions metadata will be written directly to the image whereas for Read–only images XMP sidecar will be used.

To be safe you could make all your photos read only, and then choose option 4 (or simply choose option 2).

Now you should have all your images in a folder, where each image has a corresponding .xmp file with the face tagging information. I think this is as "universal" as it gets.

\$\endgroup\$
1
  • \$\begingroup\$ Beat me to it and with details on the Digikam options. :) \$\endgroup\$
    – StarGeek
    Aug 10, 2022 at 13:37
1
\$\begingroup\$

What you'll want to use are XMP sidecar files. These hold XMP data such as image face regions and IPTC Core/Ext data in a file with the same base name and an .xmp extension. They are standard when dealing with RAW image types such as CR2 or NEF files, as most people don't want those file types to be edited. DigiKam will probably create them by default for those file types.

By default, Digikam will write directly into your jpgs if you make any changes to the metadata, which will always change the hash. You'll have to see if there's an option to force the use of XMP sidecar files for all file types.

You should take note that Digikam does have the ability to search for duplicate images. It does this by creating a perceptual or image hash of the image, not to be confused with a digital hash such as SHA256. This type of has the ability to find similar but not necessarily exact images. See Image hashing with OpenCV and Python for some examples.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.