Bug 449406 - Photograph Properties incorrect after saving in image editor
Summary: Photograph Properties incorrect after saving in image editor
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: ImageEditor-Save (other bugs)
Version First Reported In: 7.5.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-31 09:20 UTC by pipo12345
Modified: 2022-03-21 08:34 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 7.7.0
Sentry Crash Report:


Attachments
Sidecar settings for which the problem occurs (121.70 KB, image/png)
2022-03-16 12:03 UTC, pipo12345
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pipo12345 2022-01-31 09:20:08 UTC
SUMMARY
When modifying an image (I only tried for JPEGs) using the Image Editor and saving the modifications as a new version, most of the "Photograph Properties" displayed in the "Properties" tab are either "unavailable" or different from the original values. For example

Lens: <my lense>
Aperture: 1.2
Focal: 25.0 mm
Exposure: (1/50)
Sensitivity: 1250 ISO
Mode/Program: Manual / Manual
Flash: Yes, did not fire
White balance: Auto

after saving becomes

Lens: unavailable
Aperture: F0.53
Focal: unavailable
Exposure: 1/50 s
Sensitivity: 1250 ISO
Mode/Program: unavailable
Flash: unavailable
White balance: unavailable


STEPS TO REPRODUCE
1. Open an image (JPEG) in Image Editor
2. Do some modifications
3. Save as new version

OBSERVED RESULT
Most of the "Photograph Properties" are either "unavailable" or incorrect/different from those of the original image.

EXPECTED RESULT
The "Photograph Properties" should not differ from those of the original image. At least those that are not "unavailable" shall be identical to the original values.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Ubuntu 20.04.3 LTS
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
Comment 1 caulier.gilles 2022-01-31 09:28:57 UTC
Save as new version --> in which file format exactly ?
Comment 2 pipo12345 2022-01-31 10:54:36 UTC
The problem occurs for all offered formats, i.e. JPEG, TIFF, PNG and PGF.(In reply to caulier.gilles from comment #1)
> Save as new version --> in which file format exactly ?

The problem occurs for all offered formats, i.e. JPEG, TIFF, PNG and PGF.
Comment 3 Maik Qualmann 2022-01-31 12:01:24 UTC
I can't reproduce the problem on either Linux or Windows, all photography metadata is preserved. You are using Ubuntu snap package, this snap package is useless. We have already received a large number of bug reports with this package. Snap packages use a sandox. Therefore, there will be problems when accessing files. Use our AppImage. There is now also a private repository, owned by an Ubuntu user who builds native up-to-date digiKam packages. I'll post the link soon...

Maik
Comment 5 pipo12345 2022-01-31 12:37:39 UTC
(In reply to Maik Qualmann from comment #3)
> I can't reproduce the problem on either Linux or Windows, all photography
> metadata is preserved. You are using Ubuntu snap package, this snap package
> is useless. We have already received a large number of bug reports with this
> package. Snap packages use a sandox. Therefore, there will be problems when
> accessing files. Use our AppImage. There is now also a private repository,
> owned by an Ubuntu user who builds native up-to-date digiKam packages. I'll
> post the link soon...
> 
> Maik

Just to double-check. By metadata you're also referring to the information in the "Properties" tab, right? Just asking because the values in the "Metadata tab" are actually correct. Could you please confirm?
Comment 6 Maik Qualmann 2022-01-31 13:06:40 UTC
Yes, I am also referring to the Properties tab. Does the metadata appear correct when you re-read the metadata via Menu->Item?

Maik
Comment 7 pipo12345 2022-01-31 13:54:01 UTC
Thanks a lot for the confirmation! Unfortunately re-reading the metadata doesn't change anything. So, it might be that this is indeed snap related.

In a few weeks I'll upgrade my Ubuntu and switch to either the Ubuntu distribution version or the AppImage following your advise. Thanks a lot for your recommendation. In fact, I have also read quite a lot about issues with the snap version lately.
Comment 8 pipo12345 2022-03-16 04:54:41 UTC
I finally managed to switching to digikam AppImage version 7.5.0 and, unfortunately, the issue persists. But after trying out a few things, I noticed that the issue only occurs if "Write to sidecar files" is checked. When unchecked, the "Photograph Properties" are as expected. Can you reproduce this?
Comment 9 caulier.gilles 2022-03-16 05:31:51 UTC
Why not to try last AppImage 7.6.0 instead 7.5.0 ?
Comment 10 Maik Qualmann 2022-03-16 09:25:03 UTC
Please post your complete sidecar settings or a screenshot of the sidecar settings.

Maik
Comment 11 pipo12345 2022-03-16 12:03:03 UTC
Created attachment 147526 [details]
Sidecar settings for which the problem occurs

Added sidecar settings for which the problem occurs.
Comment 12 Maik Qualmann 2022-03-16 17:51:33 UTC
Ok, I can reproduce the problem with these settings. The problem is clear. All metadata is only written as XMP.Exif in the sidecar only. We lose Makernotes (mostly lens information) and other stuff. Different values in aperture and exposure time result from different conversion of the values in XMP compared to Exif. Similar to DNG files, we could manually copy the lens metadata to XMP.

However, I would suggest that whenever a new image is created via the DImg API, we always copy metadata into the image, regardless of the sidecar settings.

Maik
Comment 13 pipo12345 2022-03-16 18:40:30 UTC
Great, thanks for checking. I would also agree with always storing the metadata in the image file itself when it's created by the Image Editor.
Comment 14 Maik Qualmann 2022-03-16 20:24:21 UTC
Git commit 5c7059bd2de9ca2e2d0c047be4cfc970c38c622b by Maik Qualmann.
Committed on 16/03/2022 at 20:23.
Pushed by mqualmann into branch 'qt5-maintenance'.

always copy/write metadata to new image files
FIXED-IN: 7.7.0

M  +2    -1    NEWS
M  +5    -0    core/libs/dimg/loaders/dimgloader.cpp

https://invent.kde.org/graphics/digikam/commit/5c7059bd2de9ca2e2d0c047be4cfc970c38c622b
Comment 15 pipo12345 2022-03-17 04:34:29 UTC
Thanks for fixing. I have a potentially stupid question regarding your changes though. If I have set my sidecar settings to "Write to XMP sidecar only" and then save an image in the Image Editor, the setting will be changed to "Write to item and XMP Sidecar". This updated setting will then persist outside of the Image Editor, too, right? Wouldn't it be better to only temporarily update the setting and restore restore the original one after having saved the file?
Comment 16 Maik Qualmann 2022-03-18 07:05:52 UTC
The setting only changes for this one write and does not change globally.

Maik
Comment 17 pipo12345 2022-03-21 08:34:07 UTC
Ok, perfect. Thanks for clarification!