CFIMAGE generates java error

Posted At : August 5, 2008 8:24 AM | Posted By : Dave
Related Categories: ColdFusion

While doing some image work this morning with watermarking I came across this strange error:

Error Occurred While Processing Request
General CMM error517

Here is part of the stack trace:

java.awt.color.CMMException: General CMM error517
   at sun.awt.color.CMM.checkStatus(CMM.java:127)
   at sun.awt.color.ICC_Transform.<init>(ICC_Transform.java:89)
   at java.awt.color.ICC_ColorSpace.fromRGB(ICC_ColorSpace.java:197)
   at java.awt.image.ComponentColorModel.getDataElements(ComponentColorModel.java:1560)

After doing a quick search (the internet is cool huh?), I was able to find this: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6444360. This issue that I ran into is apparently a recorded bug in JAVA. The bug was reported 2 years ago and it apparently has not been corrected.

The issue is with the jpg file I was trying to use. It apparently has a corrupt color profile and java can't handle it. I did check the properties of the file and noticed that the color representation property was set to uncalibrated. I was able to open the file in Fireworks and saved it as a new file and the new file works fine.

I have not found a way around it yet. The error happened when I tried to paste a one image onto another using ImagePaste.

Till next time...

--Dave

Comments
Could you catch for the error message, then in the catch change the color space, then continue? I don't think CF permits modifying the colormodel.colorspace value but you might find another way to change the field (to a valid value).
# Posted By Steven Erat | 8/5/08 10:23 AM
Reading the stack trace, I see the error occurs when in a method that intends to change or transform the color space: ICC_Transform() so from CF or Java there's probably no way to make that change.
# Posted By Steven Erat | 8/5/08 10:27 AM