The Coldfusion Open Source Forums
Home | ImageCFC | CFFM | BlogCFM | CFMBB | CFOpenMail / ImapCFC | CFOpenChat
Forums | Profile | Inbox | Members | Chat | Search | Login | RSS
Vivio Technologies CFML Hosting
New Topic Reply Subscription Options   Previous Page  Page: 1   Previous Page

Forums: ImageCFC Forum: JPEG Java Read Error
Created on: 02/11/11 {ts '2018-12-15 15:29:00'} Views: 14050 Replies: 5
JPEG Java Read Error
Posted Friday, February 11, 2011 at {ts '2018-12-15 15:29:00'}

I am looping through a list of images in a folder and having imageCFC read each image. The code works either until it gets to the last .JPG image or if there is only 1 image to process at which point I get a "Java is unable to read jpg files" error.

I am running CF8 and have tested this will images that I know work. For example. If I change the order of the images, all images are read perfectly, except for the last image in the loop. The same holds true for a single image upload. Whenever I have the code try to read in an image, the CFC immediately gives an error when trying to read the image. This same image is read fine if it's uploaded with other images.

Here are the basics of the code before it ever gets to the resizing aspect. It's the third line getImageInfo where it throws the error if its the only image that needs processing or the last image that needs processing.

Any suggestions would be much appreciated.


<cfset imageCFC = createObject("component","image")>

<cfset testgraphic = "#currentpath#\gallery\temp\#session.userimage#\#i#">

<cfset imgInfo = imageCFC.getImageInfo("", "#testgraphic#")>

RE: JPEG Java Read Error
Posted Friday, February 11, 2011 at {ts '2018-12-15 18:36:00'}

So, what you're saying is that when you upload images and this code loops through to resize them, the LAST image it attempts to resize always generates an error, whether you upload one image or 10 images?

RE: JPEG Java Read Error
Posted Friday, February 11, 2011 at {ts '2018-12-15 22:25:00'}

Hi Rick,

Yes, that's exactly what happens and I'm stumped. It makes no sense to me. It throws an error let's say on an image titled "bermuda.jpg," yet if I make that same image just one of many, it re-sizes it without problem - as long as it's not the last image.

RE: JPEG Java Read Error
Posted Saturday, February 12, 2011 at {ts '2018-12-15 07:54:00'}

I dunno, that sounds to me like an issue with the way the loop is working.

Were I debugging such an issue, I'd probably <cflog> the full path filename right before the call to getImageInfo() to make sure it's doing what you think it's doing.

RE: JPEG Java Read Error
Posted Monday, February 14, 2011 at {ts '2018-12-15 01:55:00'}

I just tried using CFIMAGE instead of imageCFC and actually got the same result...The last JPG in the loop throws an error, yet if it's one of many (as long as it's not the last) it will process fine. This leads me to believe that it's a JAVA or JVM issue. I was using 1.6 version 10 and just upgraded to version 23(?) but the outcome is the same.

Any thoughts?

Thanks in advance.

Ron

RE: JPEG Java Read Error
Posted Monday, February 14, 2011 at {ts '2018-12-15 20:32:00'}

I doubt that it has anything to do with Java or JVM. Especially if sometimes an image resizes fine when it's not the last image, and the last image always fails no matter what.

As for my thoughts, please see my previous response.


Like I said, I think you've got a problem in the code that is completely unrelated to the act of resizing the image.

New Topic Reply Subscription Options   Previous Page  Page: 1   Previous Page
Subscription Options
Subscription options are available after you log in.

There are 12 active user sessions right now.