Tuesday, June 5, 2012

ColdFusion 10 & Image Enhancements

With ColdFusion 10 there are some image enhancements done. Here is a list of those enhancements -

1. Image Resize and interpolation: With ImageResize and ImageScaleToFit , interpolation is one of the parameters. This Interpolation argument control quality of resultant image. This has an impact on performance.  Higher the quality, slower the response time will be. Possible value for this argument are  highestQuality (default), highQuality, mediumQuality, highestPerformance, highPerformance, mediumPerformance, nearest, bilinear, bicubic, bessel, blackman, hamming, hanning, hermite, lanczos, mitchell, quadratic.  

With ColdFusion 10, this support is added in cfimage tag as well. Now for cfimage action="resize", interpolation is one of the possible attribute.  Default value is kept in sync with the function equivalents of this action.

2. ImageDrawText: ImageDrawText method will now return a struct containing the width of the text drawn and the height of the text drawn.

3. CMYK Image support: CMYK Images were not working for Mac and 64bit OS. we have added support for the same.

4. Fixed a bug in ImageGrayScale with TiFF images.

5. Captcha Creation: ImageCreateCaptcha method support is added. 
      ImageCreateCaptcha(int height, int width, String text)
      ImageCreateCaptcha(int height, int width, String text, String difficulty)
      ImageCreateCaptcha(int height, int width, String text, String difficulty, String fonts,  int fontSize)

6, Change in behavior for action="captcha":  Added name attribute to action="captcha" for cfimage tag. This new attribute name will contain the image variable object.Now inline captcha will be rendered only when name and destination are not specified. Else if name is specified, image will be saved in variable like other image functions. If destination is specified, captcha image will be saved at the location mentioned.

7. For cfimage action = "captcha", if user specified font is not found, it will fall back to system fonts

8. ImageMakeColorTransparent: New method ImageMakeColorTransparent  is added. This will create an image and set a transparent color

9. ImageMakeTranslucent: New method  ImageMakeTranslucent  is added. This will create a new translucent imagewith given percentage of translucence
     ImageMakeTranslucent (imgpercent)

10. New Parameters for ImageOverlay: New parameters rule and alpha are added for the function ImageOverlay.
     ImageOverlay(source1, source2, [rule, alpha]))

For detailed information on all these APIs refer to ColdFusion 10 documentation.

If you see memory leak you can explore using memory leak fix done by Jpedal for JAI. You can read about it and download from here.


  1. Is this image bug fixed in 10?

  2. Hi Sparky,

    This is not fixed in ColdFusion 10.



You can subscribe to the comments by licking on "Subscribe by email".