Summary: | RawEngine contains invalid icc profiles, applications fail to save png file with libpng-1.6.x | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Andreas K. Huettel <dilfridge> |
Component: | Plugin-DImg-RAW | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles, digikam-bugs-null, johu, vivo75+kde |
Priority: | NOR | ||
Version: | 3.0.0 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=466798 | ||
Latest Commit: | http://commits.kde.org/libkdcraw/92a57e163222ef9ee072964eb5cad92d9567a24d | Version Fixed In: | 3.2.0 |
Sentry Crash Report: | |||
Attachments: | srgb-d65.icm |
Description
Andreas K. Huettel
2013-05-03 10:47:08 UTC
I plan to look at this next weekend 4/5-05/2013 after some research seem libpng cannot handle srgb-d65.icm from libkdcraw From the Gentoo bug report: --- Comment #8 from John Bowler <jbowler##acm.org> --- ICC profiles are required to have a length which is a multiple of 4, so the profile in question is broken. (See 7.1.2(c) in the spec and "NOTE 1" that follows it then read 7.2.2 - the length includes the pad bytes.) I believe there was (and maybe is) an app that was writing text strings at the end of the profile and, if the text string was not a multiple of 4 in length, it would produce a bad profile. Those profiles are easy to fix - just pad the string with \0 - but other bugs where the profile length is calculated wrong may result in serious errors. (libpng does go on to validate the length, but when the length is detectably broken at the start it simply rejects the profile.) This is a benign error on read and the profile will be ignored (along with any other colorspace information in the PNG) but on write it gets converted into an application error - we don't want to write PNGs with detectably broken profiles, something else may crash! The KDE upstream need to fix the profile, it should be easy. krita in calligra also has some Created attachment 79736 [details]
srgb-d65.icm
this profile has been padded with 0 to 6924 bytes (with okteta hex editor) and the header updated to the new size.
every upstream software (libpng and lcms) confirmed that icc profiles are padded to 4 byte and that the software involved is conformat since a looong time. so it's ok to simply replace the original profile with a padded one. Git commit ca2274e40d065e12123f6d32db3c6fe153e621a2 by Francesco Riosa. Committed on 09/05/2013 at 18:41. Pushed by riosa into branch 'master'. ICC profiles should be padded to 4 bytes In practice with libpng >= 1.6 the profile cannot be embedded if it has the wrong size thus preventing digikam/showfoto to write png files at all. see also M +- -- profiles/srgb-d65.icm http://commits.kde.org/libkdcraw/ca2274e40d065e12123f6d32db3c6fe153e621a2 Git commit 92a57e163222ef9ee072964eb5cad92d9567a24d by Francesco Riosa. Committed on 09/05/2013 at 18:41. Pushed by riosa into branch 'KDE/4.10'. ICC profiles should be padded to 4 bytes In practice with libpng >= 1.6 the profile cannot be embedded if it has the wrong size thus preventing digikam/showfoto to write png files at all. see also M +- -- profiles/srgb-d65.icm http://commits.kde.org/libkdcraw/92a57e163222ef9ee072964eb5cad92d9567a24d |