Created attachment 176986 [details] Picture with corrupted colors after I assigned the tag in Digicam DigiKam changes the colors of an HEIF picture once a Tag is assigned. The HEIC is still shown correctly in DigiKam, but if the file is looked at on the OS level or copied back to the iPhone, the colors are incorrect. STEPS TO REPRODUCE 1. Take a picture with an iPhone 14 and add it to a folder which is added as a DigiKam Collection 2. Double click the file and open - looks fine. Check on Finder/OS level, File is still fine 3. In Captions/Tags select a Tag (in my case "_Album") and assign it to the HEIC OBSERVED RESULT 1. The HEIC File is changed and an .xmp is created 2. Check the HEIC File on Finder/OS Level and see the corrupted colors (see attached file IMG_1295.heic.) 3. Compared the corrupted File vs. the original file "IMG_1295_original.heic" - original looks fine EXPECTED RESULT No changes in the color in the original file SOFTWARE/OS VERSIONS macOS: Sonoma 14.6.1 ExifTools: 13.10 ADDITIONAL INFORMATION
The cause is related to the color profile. This bug is fixed in digiKam-8.6.0, pre-release version is available here: https://files.kde.org/digikam/ Maik
For digiKam-8.5.0 you can activate the reading of metadata with ExifTool as a workaround. Maik
@Mike: Thx for the super-fast feedback. Turning on Exiftools to READ the Metadata (+restarting DigiKam) did unfortunately not solve the issue (fyi). I will upgrade to the 8.6 after doing a backup.
Can you please provide an original HEIC file? Maik
Created attachment 176989 [details] Original heic file
could not update to 8.6 as I am running an intel based Mac and there is no .dmg / pkg for Intel Mac available yet - so can't test on 8.6 if bug is fixed on macOS.
Look in the "legacy" folder, there is the Intel version. Maik
Thx a lot for your instant reply. I installed 8.6 (Build 30.12.24 20:02) - unfortunately the problem remains. I started with a fresh iPhone Image which shows nicely in DigiKam and when previewed in Finder, but once I tag the image with DigiKam, the colors are shown wrong in Finder. From within DigiKam the colors of the image do not change. I also checked if the problem disappears if I separate the changed image from the xml - but even if I move the changed image without the corresponding .xmp to another place, colors are still wrong when viewed on Finder. Can I provide any further help to solve the issue? Best, Tom
It's clear that metadata as changed between original and tagged new one. Probably a tag is reaffected to a wrong value or something like that. The good news is that image data is not touched while this process, as metadata are store in separated chuck in file. Can you extract with exiftool the metadata between both files and compare ?
As Maik said, it's probably relevant of color profile properties. Also please double check with another application to show the HEIF (not digiKam). Q: did you use a color profile for your screen ?
The original HEIC file has two additional ICC profiles in addition to the Apple ICC profile. These are not being adopted since we copied the ICC profiles with ExifTool. I have not found any program in the Linux world that uses these additional profiles. Let's see how we can fix this. ---- ICC_Profile ---- Profile Description : Display P3 Profile Copyright : Copyright Apple Inc., 2022 Media White Point : 0.96419 1 0.82489 Red Matrix Column : 0.51512 0.2412 -0.00105 Green Matrix Column : 0.29198 0.69225 0.04189 Blue Matrix Column : 0.1571 0.06657 0.78407 Red Tone Reproduction Curve : (Binary data 32 bytes, use -b option to extract) Chromatic Adaptation : 1.04788 0.02292 -0.0502 0.02959 0.99048 -0.01706 -0.00923 0.01508 0.75168 Blue Tone Reproduction Curve : (Binary data 32 bytes, use -b option to extract) Green Tone Reproduction Curve : (Binary data 32 bytes, use -b option to extract) ---- ICC_Profile2 ---- Gray Tone Reproduction Curve : (Binary data 14 bytes, use -b option to extract) ---- ICC_Profile3 ---- A To B0 : (Binary data 19478 bytes, use -b option to extract) B To A0 : (Binary data 6412 bytes, use -b option to extract) Luminance : 0 100 0 Maik
Yes, I have calibrated bei Mac and I am using an own profile (Apple iMac-1 2024 08).
Created attachment 177003 [details] Metadata difference between original HEIC and status after adding a tag with Digikam
Git commit cd2fe076c323c41b300d25e446c5436d6edfdeb0 by Maik Qualmann. Committed on 01/01/2025 at 10:27. Pushed by mqualmann into branch 'master'. workaround for images from Apple devices with extra color profiles FIXED-IN: 8.6.0 M +1 -1 NEWS M +5 -0 core/libs/metadataengine/engine/metaengine.cpp https://invent.kde.org/graphics/digikam/-/commit/cd2fe076c323c41b300d25e446c5436d6edfdeb0
In order not to break Bug 495646, we have to do a workaround at the moment. Images from current Apple devices can contain extra color profiles, these have names like AToB0 or BToA0 in ExifTool as an example. These extra color profiles can only be read by ExifTool, they are not writable, i.e. they cannot be copied to another image. Therefore, we currently ignore the ICC profiles when reading the metadata with ExifTool from Apple devices. This means that no new profiles are written and the existing ones are not changed/deleted. Maik
Dear Maik, happy New Year! I installed Build 01.01.25 16:02 and the problem does not appear anymore. You made my day!! Best, Tom