Version: 1.6.0 (using KDE KDE 3.5.2) Installed from: Gentoo Packages Compiler: gcc 4.1.1 OS: Linux When there is a non-conforming ICC profile in a profile directory such as ~/.color/icc Krita will go into a loop and never open. I have a profile that I got from a user of my application (LProf) that does not conform to ICC standards. This profile was shipped by the hardware vendor with a common scanner. I have been using this profile for testing LProf code to make sure that non-conforming profiles do not cause problems. When I installed Krita 1.6.0 and started it all it did was the following: lcms: Error #4096; Read from memory error. Got 0 bytes, block should be of 2 bytes lcms: Error #4096; Read from memory error. Got 0 bytes, block should be of 2 bytes lcms: Error #4096; Read from memory error. Got 0 bytes, block should be of 2 bytes lcms: Error #4096; Read from memory error. Got 0 bytes, block should be of 2 bytes lcms: Error #4096; Read from memory error. Got 0 bytes, block should be of 2 bytes lcms: Error #4096; Read from memory error. Got 0 bytes, block should be of 2 bytes lcms: Error #4096; Read from memory error. Got 0 bytes, block should be of 2 bytes I had to kill it to stop this. I don't see any way to attach the profile to this bug report so that you can use it as a test case. So please email me and I will send it to whoever needs it for testing. By the way this same profile has been used by the Scribus team and and also the author of LCMS for testing. LCMS 1.16 should have fixes that prevent this from happening when it is released. I currently have LCMS 1.15 installed. Also renaming the profile so that Krita did not try to open it made the problem go away. But most users might not know what the cause is and how to work around it if they should happen to have a similar profile on their system. Marti Maria has told me that he thinks that about 25% of the profiles out there are non-conforming in some way. So this type of thing is a fairly common problem.
you can attach a file clicking on "Create a New attachment" at the bottom of the page (or send it to me at cyb@lepi.org). Do you know if there is a way in 1.15 to detect those profile ? The only check we do is wether lcms succeed to load the profile or not.
Right, I was told about this by mrdocs, but iirc it was kinda late in the 1.6.0 cycle to start adding the code for that. Apparently Scribus has code for this that we should 'borrow' ;-) You should be able to add the profile through http://bugs.kde.org/attachment.cgi?bugid=136103&action=enter to the bugreport, btw. I'm confirming this bug anyway (since we should sanity check), but it'd still be handy to have a testcase.
Created attachment 18218 [details] non-conforming ICC profile Here is the profile. Sorry I missed the Create New Attachment button.
You have to use cmsSetErrorHandler from lcms to trap errors. That way when lcms has some type of problem with a profile your error handler will be called and you can do whatever is needed. In LProf I dump a message to the console and then by pass the profile that caused the error handler to be called. My code is basically a clone of the code that Scribus impletented for this same type of thing. Once you have this in place it will trap any profile errors that lcms detects that would otherwise cause it to do whatever action is set by cmsErrorAction (LCMS_ERROR_ABORT is default but it looks like Krita is using LCMS_ERROR_SHOW)
I just tried reproducing this error and it doesn't seem to be in KOffice2 (trunk r875799) any longer. I added the corrupted profile to ~/.local/share/color/icc/krita and krita doesn't loop (but seems to find the file).
We do check for validity now, so this bug can be closed. Thanks!