Answered
Strange imageWrite() Behaviour on Specific JPG files
Hi,
I have written an application to upload files and process them etc. Everything works fine.
However, certain JPG files cause an error in the imageWrite() function where I try to set the image quality.
An exception occured while trying to write the image.
Ensure that the destination directory exists and that Coldfusion has permission to write to the given path or file. cause : java.io.FileNotFoundException: C:\ColdFusion8\wwwroot\cms\skylitecms\cmsFiles\P61901721.JPG (The system cannot find the file specified)
I have seen this error around the Internet, but that was concerning transparent GIF files.
I can confirm that the directory DOES exist and other images save just fine. I noticed oddly enough that the images erroring were images I had taken with my digital camera - ALL of them error! But, if I open the image up in FireWorks, export it as a JPG (like it is already), then upload THAT new JPG file, it works.
So the problem seems to be specific to these JPG files, but I can't understand why. I CFDUMP the upload from CFFILE and all of the variables seem normal - in particular, the "FILEWASSAVED" returned from the struct in the CFDUMP says "YES" but when I go to look in the folder it's not there....which is presumably why the imageWrite() fails?
This is very odd.
Please take a look at both image files and see if you have any problems with them.
The image that errors:
www.unibands.co.uk/P6190172.jpg
The re-exported image that works:
www.unibands.co.uk/newP6190172.jpg
Any help would be greatly appreciated. Apologies for the size of the images, they're quite large but I wanted to change as little as possible and didn't want to tamper with the original incase it changed anything. And yes, that is my dog!! :)
Many thanks in advance for your help.
Mikey.
I have written an application to upload files and process them etc. Everything works fine.
However, certain JPG files cause an error in the imageWrite() function where I try to set the image quality.
An exception occured while trying to write the image.
Ensure that the destination directory exists and that Coldfusion has permission to write to the given path or file. cause : java.io.FileNotFoundException: C:\ColdFusion8\wwwroot\cms\skylitecms\cmsFiles\P61901721.JPG (The system cannot find the file specified)
I have seen this error around the Internet, but that was concerning transparent GIF files.
I can confirm that the directory DOES exist and other images save just fine. I noticed oddly enough that the images erroring were images I had taken with my digital camera - ALL of them error! But, if I open the image up in FireWorks, export it as a JPG (like it is already), then upload THAT new JPG file, it works.
So the problem seems to be specific to these JPG files, but I can't understand why. I CFDUMP the upload from CFFILE and all of the variables seem normal - in particular, the "FILEWASSAVED" returned from the struct in the CFDUMP says "YES" but when I go to look in the folder it's not there....which is presumably why the imageWrite() fails?
This is very odd.
Please take a look at both image files and see if you have any problems with them.
The image that errors:
www.unibands.co.uk/P6190172.jpg
The re-exported image that works:
www.unibands.co.uk/newP6190172.jpg
Any help would be greatly appreciated. Apologies for the size of the images, they're quite large but I wanted to change as little as possible and didn't want to tamper with the original incase it changed anything. And yes, that is my dog!! :)
Many thanks in advance for your help.
Mikey.
