Bug 520982 - Kra file cannot be saved with invalid value in a XMP exif metadata
Summary: Kra file cannot be saved with invalid value in a XMP exif metadata
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (other bugs)
Version First Reported In: 5.3.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Tiar
URL:
Keywords:
: 522027 (view as bug list)
Depends on:
Blocks:
 
Reported: 2026-06-02 21:52 UTC by Tiar
Modified: 2026-06-22 22:18 UTC (History)
1 user (show)

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


Attachments
Test file (2.22 MB, application/x-krita)
2026-06-02 21:52 UTC, Tiar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2026-06-02 21:52:12 UTC
Created attachment 192833 [details]
Test file

DESCRIPTION
Krita fails to produce a .kra file if an entry in XMP exif metadata has an invalid value

Test file comes from bug 495329

STEPS TO REPRODUCE
1. Open the test file (make sure you open it before the bug 520981 is fixed).
2. Try to save the test file somewhere as .kra file.

OBSERVED RESULT
"Could not save [filename]
Unknown error
- The metadata backend failed to save the metadata for Figure A.
- Failed to save the metadata for layer Figure A." (and so on for each layer).

EXPECTED RESULT
Correctly saved file, possibly with a warning about missing/broken metadata.

SOFTWARE/OS VERSIONS
Krita 5.3.2
Comment 1 Dmitry Kazakov 2026-06-22 11:08:06 UTC
Git commit 489a52258df9398850f6561b85d6f898c30ad806 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 22/06/2026 at 11:07.
Pushed by dkazakov into branch 'master'.

Add KisUsageLogger logging for invalid metadata

Before this commit, invalid metadata would show up in LogViewer when
turned on metadata filter, but that caused a lot of lines and it
wouldn't be visible in the Krita usage log. This commit adds logging
into Krita Usage Log so failures to parse or save metadata are
leaving a trace in the log file.
Related: bug 520981

M  +11   -1    plugins/metadata/xmp/kis_xmp_io.cpp

https://invent.kde.org/graphics/krita/-/commit/489a52258df9398850f6561b85d6f898c30ad806
Comment 2 Dmitry Kazakov 2026-06-22 11:08:11 UTC
Git commit 603cbacec49c3ed9df05eb3ee9be0906452067e5 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 22/06/2026 at 11:07.
Pushed by dkazakov into branch 'master'.

Omit invalid values for xmp metadata when saving

Before this commit, if there was an invalid value for xmp exif
metadata, Krita would fail saving to a kra file because the xmp encoder
would complain about it.
This commit just omits encoding the invalid values and warns about it in
logs.

M  +3    -1    plugins/metadata/xmp/kis_xmp_io.cpp

https://invent.kde.org/graphics/krita/-/commit/603cbacec49c3ed9df05eb3ee9be0906452067e5
Comment 3 Dmitry Kazakov 2026-06-22 11:08:41 UTC
Git commit 285d51e15dd3250235827317f0e6a07a25e56538 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 22/06/2026 at 11:08.
Pushed by dkazakov into branch 'krita/6.0'.

Omit invalid values for xmp metadata when saving

Before this commit, if there was an invalid value for xmp exif
metadata, Krita would fail saving to a kra file because the xmp encoder
would complain about it.
This commit just omits encoding the invalid values and warns about it in
logs.

M  +3    -1    plugins/metadata/xmp/kis_xmp_io.cpp

https://invent.kde.org/graphics/krita/-/commit/285d51e15dd3250235827317f0e6a07a25e56538
Comment 4 Dmitry Kazakov 2026-06-22 11:08:44 UTC
Git commit 5e541796a4ddfc2b3c266a5fda058c5489df4dc3 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 22/06/2026 at 11:08.
Pushed by dkazakov into branch 'krita/6.0'.

Add KisUsageLogger logging for invalid metadata

Before this commit, invalid metadata would show up in LogViewer when
turned on metadata filter, but that caused a lot of lines and it
wouldn't be visible in the Krita usage log. This commit adds logging
into Krita Usage Log so failures to parse or save metadata are
leaving a trace in the log file.
Related: bug 520981

M  +11   -1    plugins/metadata/xmp/kis_xmp_io.cpp

https://invent.kde.org/graphics/krita/-/commit/5e541796a4ddfc2b3c266a5fda058c5489df4dc3
Comment 5 buggykrita 2026-06-22 22:18:56 UTC
*** Bug 522027 has been marked as a duplicate of this bug. ***