tracker issue : CF-3596008

select a category, or use search below
(searches all categories and all time range)

Inconsistent Handling of JPEG Images resulting in "ImageReadingException" Errors

| View in Tracker

Status/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:

thisDirectory = getDirectoryFromPath(GetCurrentTemplatePath());
imageFilePath = thisDirectory & "/testCmykImage.jpg";
img = ImageNew(imageFilePath);

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/ 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(
	at coldfusion.image.ImageReader.readImage(
	at coldfusion.image.Image.<init>(
	at coldfusion.runtime.CFPage.ImageNew(
	at cfimageTest2ecfm1770476121.runPage(/webroot/docs/imageTest.cfm:4)...

Expected Result:

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

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

Java Home	 /app/java/jdk1.7.0_09/jre  

Java File Encoding	 UTF8  

Java Default Locale	 en_US


  1. July 16, 2013 00:00:00: 1_testCmykImage.jpg


I'm using ColdFusion 10,0,11,285380 w/Java 1.7.0_15 on Windows Server 2008 R2 64bit and your sample CMYK image is not detected as a valid image. I've never seen "Any of the family of CMYK color spaces" on any of the CMYK images I've successfully tested. More info here: As a baseline test, I've used the Wikipedia imagefile provided for the CMYK entry (datestamped 2005) and ColdFusion 10 is not able to read it: On another note, CMYK images that I've been able to read are converted to RGB when resaved using ImageWrite(). Is this a bug? (I was under the impression that conversion was not possible and that CMYK files were able to be saved.)
Comment by External U.
14924 | July 16, 2013 11:09:26 AM GMT
Tested in Windows 7 with 32 and 64-bit java, WebLogic server Colorspace is coming as : Any of the family of RGB color spaces Should be : Any of the family of CMYK color spaces (Comment added from ex-user id:nawani)
Comment by Adobe D.
14925 | December 09, 2013 02:07:20 AM GMT
Also the below attributes shows different values then expected: Attribute Actual Expected num_color_components 3 4 num_components 3 4 pixel_size 24 32 and the below attributes are missing: height source width (Comment added from ex-user id:nawani)
Comment by Adobe D.
14926 | December 09, 2013 02:16:50 AM GMT
Can you please clarify the status of this ticket? On one hand it says "to track", on the other hand it says "fixed in 286296". -- Adam
Comment by External U.
14927 | June 24, 2014 09:55:03 AM GMT
I'm using ColdFusion 10,287689 Developer (On Windows 2008 R2 64bit) with Java 1.7.0_15 and isImageFile() and isImage() both fail. I've tested the sample code (and CMYK image above) and get the error "An exception occurred while trying to read the image. ICC APP2 encountered without prior JFIF!"
Comment by External U.
14928 | June 24, 2014 10:41:14 AM GMT
OK, so "not fixed" then :-( -- Adam
Comment by External U.
14929 | June 24, 2014 10:50:11 AM GMT
getting several of these a day, hope a fix comes soon
Vote by External U.
14933 | March 03, 2015 02:14:48 PM GMT
Third Party dependency still unresolved (, so we may have to close this.
Comment by Vamseekrishna N.
14930 | August 18, 2016 01:03:09 AM GMT
Since the Third Party dependency has been unresolved closing the bug. Thanks!
Comment by S P.
14931 | September 25, 2017 06:00:47 AM GMT
Can the Adobe folks who closed this add a little more info for those who may come across this later, seeking info on the state of CF support for CMYK? You say you closed the bug because a "third party dependency" is "unresolved". Is that referring to something in CF or something in the environment of the folks reporting the bug? If in CF, where does that leave folks with this problem? I see no other discussion here of this "dependency". Thanks
Comment by Charlie A.
14932 | September 28, 2017 01:29:13 PM GMT