Title:
Inconsistent Handling of JPEG Images resulting in "ImageReadingException" Errors
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/ThirdParty
Reporter/Name(from Bugbase): David Isenhower / David Isenhower (d_isenhower)
Created: 07/16/2013
Components: CFIMAGE
Versions: 10.0
Failure Type: Non Functioning
Found In Build/Fixed In Build: Final /
Priority/Frequency: Critical / Most users will encounter
Locale/System: English / Platforms All
Vote Count: 1
Problem Description:
My application loads images and manipulates them via ImageNew() call. In cases where a CMYK jpeg is loaded, the app throws an "coldfusion.image.ImageReader$ImageReadingException" exception. This happens for a while until the server is restarted, then it may or may not happen again.
What seems to be occurring is that coldfusion.image.ImageReader is trying to find the CLibJPEGImageReader reader from the collection returned by javax.imageio.ImageIO. This works fine if it is the first object returned in the collection, but if not, it will return another JPEG ImageReader that does not support CMYK images. I have two systems (both RedHat) which are currently in each state. One has the CLibJPEGImageReader as the first element in the ImageReader collection, and in the other, it is the second element in the collection. The code below will work fine when the correct reader is found, but not when it isn't the first element in the collection.
Steps to Reproduce:
<cfscript>
thisDirectory = getDirectoryFromPath(GetCurrentTemplatePath());
imageFilePath = thisDirectory & "/testCmykImage.jpg";
img = ImageNew(imageFilePath);
writeDump(ImageInfo(img));
</cfscript>
Sample Image file is attached to this bug
Actual Result:
An exception occurred while trying to read the image.
ICC APP2 encountered without prior JFIF!
The error occurred in /web/cms/www.ugs.com/docs/imageTest.cfm: line 4
2 : thisDirectory = getDirectoryFromPath(GetCurrentTemplatePath());
3 : imageFilePath = thisDirectory & "/testCmykImage.jpg";
4 : img = ImageNew(imageFilePath);
5 : writeDump(ImageInfo(img));
6 : </cfscript>
coldfusion.image.ImageReader$ImageReadingException: An exception occurred while trying to read the image.
at coldfusion.image.ImageReader.readJPEGImage(ImageReader.java:274)
at coldfusion.image.ImageReader.readImage(ImageReader.java:121)
at coldfusion.image.Image.<init>(Image.java:275)
at coldfusion.runtime.CFPage.ImageNew(CFPage.java:6865)
at cfimageTest2ecfm1770476121.runPage(/webroot/docs/imageTest.cfm:4)...
Expected Result:
struct
colormodel
struct
alpha_channel_support NO
alpha_premultiplied NO
bits_component_1 8
bits_component_2 8
bits_component_3 8
bits_component_4 8
colormodel_type ComponentColorModel
colorspace Any of the family of CMYK color spaces
num_color_components 4
num_components 4
pixel_size 32
transparency OPAQUE
height 2253
source /home/wwwplm/www/testCmykImage.jpg
width 3799
Any Workarounds:
None except hoping the right ImageReader is returned.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3596008
External Customer Info:
External Company:
External Customer Name: d_isenhower
External Customer Email:
External Test Config: My Hardware and Environment details:
Server Product ColdFusion
Version 10,0,11,285437
Tomcat Version 7.0.23.0
Edition Enterprise
Serial Number 1185-5003-2690-0757-5808-2952
Operating System UNIX
OS Version 2.6.18-348.4.1.el5
Update Level /app/coldfusion10/cms1/lib/updates/chf10000011.jar
Adobe Driver Version 4.1 (Build 0001)
JVM Details
Java Version 1.7.0_09
Java Vendor Oracle Corporation
Java Vendor URL http://java.oracle.com/
Java Home /app/java/jdk1.7.0_09/jre
Java File Encoding UTF8
Java Default Locale en_US
Attachments:
- July 16, 2013 00:00:00: 1_testCmykImage.jpg
Comments: