Bug 401970 - digikam break icc profile in png when modifiying metadata
Summary: digikam break icc profile in png when modifiying metadata
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Engine (show other bugs)
Version: 6.0.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-10 17:39 UTC by Nicolas.HOUDELOT
Modified: 2019-07-22 18:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas.HOUDELOT 2018-12-10 17:39:43 UTC
SUMMARY

digikam break icc profile in png when modifiying metadata

STEPS TO REPRODUCE
1. create a png with an icc profile like ProPhotoRGB (using imagemagick)

convert -profile /usr/share/color/icc/colord/sRGB.icc rose: -profile /usr/share/color/icc/colord/ProPhotoRGB.icc rose.png

2. create another png, to by modified by digikam

convert -profile /usr/share/color/icc/colord/sRGB.icc rose: -profile /usr/share/color/icc/colord/ProPhotoRGB.icc rose_modified.png

3. with digikam, just change anything on any metadata on the rose_modified.png
(tags, xmp, or iptc)


OBSERVED RESULT

the profile information has disappear on rose_modified.png
and the color profile is not readed anymore..
that cause the picture to be faded

if you convert rose.png to rose2.png
there's no error
convert rose.png rose2.png

but if you convert rose_modified.png to rose_modified2.png
you will get
digikam break icc profile in png when modifiying metadata
convert-im6.q16: iCCP: profile 'ICC PROFILE': B0070078h: exceeds application limits `rose_modified.png' @ warning/png.c/MagickPNGWarningHandler/1654.
convert-im6.q16: iCCP: CRC error `rose_modified.png' @ warning/png.c/MagickPNGWarningHandler/1654.


EXPECTED RESULT

change metadata shouldn't change the profile


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: linux Mint 19
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.49 (appimage)
Qt Version: 5.9.6 (appimage)

ADDITIONAL INFORMATION

tested with Digikam 6.0 beta2 (appimage )

also did some tests with exiv2, but there's no error at all
adding metadata to png doesn't do any corruption of the icc profile.
so it doesn't seems to be a problem with exiv2
Comment 1 Maik Qualmann 2018-12-10 19:28:20 UTC
The error is in the Exiv2 library. The problem can also be reproduced with the Exiv2 CLI tool and is therefore independent of digiKam. Please create a bug report for Exiv2 on GitHub.

Maik
Comment 2 Nicolas.HOUDELOT 2018-12-10 21:01:57 UTC
what kind of command did you use to reproduce de problem on exiv2 ?
because i did a test with those commands

exiv2 -M"reg myprefix http://ns.myprefix.me/" -M"add Xmp.myprefix.Whom Mr. Smith" -M"set Exif.Image.Artist Mr. Smith" rose_modified.png

exiv2 -M"set  Exif.Photo.UserComment  charset=Ascii  New Exif comment" rose_modified.png

exiv2 -M'set Xmp.dc.title lang="de-DE" Euros' rose_modified.png

and there was no problems..
i'm using the exiv2 bundled with ubuntu 18.04 (or mint 19)
Comment 3 Maik Qualmann 2018-12-10 21:37:00 UTC
I suspect that the Exiv2 version under Ubuntu is still 0.26. In the AppImage we use the 0.27-RC1 and also my CLI tool is the 0.27-RC1. Then the bug with the new version was introduced, I check it.

Maik
Comment 4 Nicolas.HOUDELOT 2018-12-10 22:04:29 UTC
for ubuntu,  0.25 in fact

exiv2 --version
exiv2 0.25 001900 (64 bit build)
Copyright (C) 2004-2015 Andreas Huggel.
Comment 5 Maik Qualmann 2018-12-11 07:01:07 UTC
The problem here is also to reproduce with Exiv2-0.26 CLI tool, so that problem is not new in the developer version 0.27-RC1. I can not test Exiv2-0.25 anymore. The question is, however, if not the libpng version influences it. Which libpng do you have installed?

Maik
Comment 6 Nicolas.HOUDELOT 2018-12-12 12:22:23 UTC
i'm using the appimage, so.. digikam might use the one inside.
in ubuntu 18.04 libpng is 1.6.34
Comment 7 Maik Qualmann 2018-12-16 10:47:45 UTC
The problem is reported to Exiv2 with a patch.

https://github.com/Exiv2/exiv2/issues/597

Maik
Comment 8 Maik Qualmann 2019-07-22 18:40:03 UTC
The bug is now fixed with Exiv2-0.27.1. The new pre-release AppImage from https://files.kde.org/digikam/ contains this version. I close the bug now.

Maik