Sep 14
We are running coldfusion 8 enterprise in multi-instance mode on JRUN, and we are trying to do auto image processing for uploads to convert to a standard JPG format in thumbnail and large sizes... pretty standard stuff IMHO.
The problem is that CF8's new image functions completely barf on certain types of images, including greyscale gifs, jpegs with funny colour profiles or jpegs with non-72 dpi.
This would manifest in either jrun bombs or simple resizes of images taking longer than 5 minutes to process instead of the usual < 5secs. This understandably lead to a loss of confidence from the users of the systems when our fancy new upgrade was so painfully slow.
After much frustration we fixed some of the complete bombs happening after reading some of the great tips in this post, but we still had the long processing times to deal with.
After some trial and error the way we got around it was as follows:
- Use cfimage to read in the uploaded file
- Use cfimage to save as PNG. this is the great part! saving as PNG converts the image to 72 dpi and seems to strip the erroneous colour profiles :) and doesnt affect the quality of the image
- Use cfimage to read in the new PNG
- Do what needs doing
- Delete the PNG
- Celebrate your fast and cool utility
Recent Comments