A while back I wrote a very quick photo gallery system for a client. Through a management console, they upload a photo and the server, utilizing CF8's CFIMAGE tag resizes the image to a web-safe size. Today I received an email from the client saying "It tells me every time that the photos I am trying to add are too big". I knew I wasn't checking the file size and there was no way the client was trying to upload a photo of over 100MB (server-defined post data limit). So I got to debugging.

The first file I uploaded was only 66K and it was uploaded and saved without a hitch. So I upped the ante. I tried a 7.4MB photo. This time I got an error: "Decoder cannot decode input"

I did a little Googling but after checking the first-page results didn't see a resolution. So I logged into the server and looked to see if the file actually completed uploading. Lo and behold, it did. But I noticed something. I don't even know why this stuck out to me, but it did. The filename was all uppercase. I manually changed the file extension to lowercase. When I reloaded the code to do the resizing on this image, it worked! Apparently cfimage has a problem with uppercase file extensions.

To fix the issue I simply added the following code after the file has been saved.

view plain print about
1<cffile action="rename" destination="#lcase(filename)#" source="#filename#">

After some more searching, I found that there is a fix for this issue: Adobe CFImage Fix. In fact, I had applied this .jar update. However, there is ALSO a metadata-extractor file that must be replaced that was not updated on my system.

Even after updating, I think I'll just leave the renaming code in place.