Can you please use isImage()/isImageFile() first, to ensure it is a valid CF image.
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?
<cfset isAnImageFile = false>
<cfset isAnImage = false>
<cfset isAnImageFile = true>
<cfset img = imageNew("relative_path_to_image_file")>
<cfset isAnImage = true>
<cfimage action="writeToBrowser" source="#img#">
Is an image file: <cfoutput>#isAnImageFile#</cfoutput><br>
Is an image: <cfoutput>#isAnImage#</cfoutput>
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....
it has a .jpeg
Do you still get an error when you save the file as .jpg?
but when i open it and save for web with photoshop the file is recognized as a picture file from coldfusion 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?
So did that article work for you? I've run into this before and the solution presented in that blog entry seems reasonable enough.
Hi to all,
has anyone figured this out?
Thank you, for your time
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.
The whole point is to save the time to reprocess the image file...
Actually i dont know if this is really a coldfusion bug or some damaged frame of the image?
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.
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:
- The image is cmyk (for print) not rgb (for screen/web). Save as RGB
- Someone renamed a file to .jpg (or .gif). Thinking that if htey renamed .eps to .jpg it makes it a jpg. Many programs are smart enough to figure this out and show it anyway. So just opening in FF or some other program isn't a good indication that it really is a jpeg file.
- Image is actually corrupt. Perhaps it didn't ftp all the way or some other issue caused the image to be damaged.
Was there ever a fix for it? We have the same issue and it started all of a sudden out of the blue. Using CF 9.01 CFIMAGE seem to just stop working. We resturted the CF Server - even the box with no change