I have a serious issue with cfimage... i trying to resize some jpegs.. most of them resizing is a sucess... but in some cases the resizing returns a
error "Unsupported Image Type" although IT IS a jpeg.. i read about CYMK or pjepg or sth like that... does anyone solved this "bug"?
Error Message:
An exception occurred while trying to read the
image.
Unsupported Image Type
Stack Trace
at
cfempcp_prod_add_action2ecfm1551070444.runPage(C:\Inetpub\wwwroot\life t\Admin\empcp_prod_add_action.cfm:151)
coldfusion.image.ImageReader$ImageReadingException: An exception occurred while trying to read the image. at
coldfusion.image.ImageReader.readJPEGImage(ImageReader.java:173)
at
coldfusion.image.ImageReader.readImage(ImageReader.java:96)
at
coldfusion.image.Image.<init>(Image.java:226)
at
coldfusion.tagext.io.ImageTag.doStartTag(ImageTag.java:414)
at
coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2661)
Hi Zero_Sequence,
Can you please use isImage()/isImageFile() first, to ensure it is a valid CF image.
isImage(): http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461 172e0811cbec22c24-797b.html
isImageFile(): http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461 172e0811cbec22c24-7978.html
Thanks!,
-Aaron Neff
hi itisdesign,
actually that is the issue.
Although it is a jpeg file isimage returns false.. the weird part this that ie does not display it right.. is shows only the X like when the pic file is missing..
Is there a work around for this problem? i tried to convert it into bmp and then back to jpeg but with no luck..
Although it is a jpeg file isimage returns false.. the weird part this that ie does not display it right.. is shows only the X like when the pic file is missing...
Hang on... so even IE doesn't think it's a JPG? Does Firefox?
What makes you think it's a JPG?
What image manipulation software are you using to convert it to/froma JPG?
--
Adam
First test.
<cfset isAnImageFile = false>
<cfset isAnImage = false>
<cfif IsImageFile("relative_path_to_image_file")>
<cfset isAnImageFile = true>
<cfset img = imageNew("relative_path_to_image_file")>
<cfif isImage("img")>
<cfset isAnImage = true>
<cfimage action="writeToBrowser" source="#img#">
</cfif>
</cfif>
<p>
Is an image file: <cfoutput>#isAnImageFile#</cfoutput><br>
Is an image: <cfoutput>#isAnImage#</cfoutput>
</p>
Second test:
Can you open the file with an image viewer. An image viewer like IrfanView is quite tolerant. If it fails, the file is most likely corrupt or not an image file.
Yeah, i actually can view it using all kind of pic viewers(including firefox and chrome).... so i quess it is not a corrupted file.. also it has a .jpeg so i quess its a jpeg...
The weird part its that a company provided me a cd with pictures of their products.... and some of them return false in the isimage function....
Yeah, i actually can view it using all kind of pic viewers(including firefox and chrome).... so i quess it is not a corrupted file..
Well yes and no. The internal file structure of a JPG consists of a number of "frames" (not in the video sense of that word, but a data structure sense), and it's entirely likely an invalid or corrupted frame could have gotten into the mix some how, and the JPG will still be "valid" provided the frame offset info is correct. Some apps might ignore buggered-up frames, some might not.
also it has a .jpeg so i quess its a jpeg...
Well you could rename it to have a .png extension. That doesn't make it a PNG, that just means it's got the wrong file extension. ;-)
Can you attach one of these files here so I/we can test some code out on it?
--
Adam
Hi,
Check if this workaround can help you.
http://www.oscararevalo.com/index.cfm/2008/1/26/CFImage-and-PJPEG-Imag es
Yes i already tried that solution without any good..
i attach one of the files...
1) Raise a bug with Adobe: http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html (and provide a link back to the bug here);
2) resave the files giving an error using some image-editing software, and reprocess them. I just used GIMP to resave your file, and it processed fine after that.
--
Adam
Well, sure, I realise that. However you seem short on options, so I think it's time you raised it with Adobe. And if you need to get moving with your project, I think the time's come to think of alternative approaches.
I dunno if it's a bug or just a shortfall either, but if other image-editing software can handle your file, there's no reason we should not expect CF to do so too. So by bringing this exceptional case to Adobe's attention, they might be able to do something about it.
One problem with my suggestion to raise it on the bug tracker is that one cannot attach files! I recommend including a link back to this thread where your attachment is.
--
Adam
The photo attached named SL7006-0417.jpg is of type CMYK. ColdFusion uses java to process images and java isn't able to handle the cmyk format. You must open in photoshop or some other program and save as RGB.
I have seen this issue come up a number of times and typically it is because:
North America
Europe, Middle East and Africa
Asia Pacific