Migration Guide

Guide for migrating from Adobe ColdFusion or Lucee image functions to BoxLang Image Module.

Guide for migrating from Adobe ColdFusion or Lucee image functions to BoxLang Image Module.

Table of Contents

Compatibility Overview

The BoxLang Image Module aims for high compatibility with Adobe ColdFusion and Lucee image functions. Most code should work with minimal or no changes.

Compatibility Matrix

Feature
Adobe CF
Lucee
BoxLang
Notes

ImageNew()

Full compatibility

ImageRead()

Full compatibility

ImageWrite()

Full compatibility

ImageResize()

Full compatibility

ImageRotate()

Full compatibility

ImageCrop()

Full compatibility

ImageFlip()

Full compatibility

ImageBlur()

Full compatibility

ImageSharpen()

Full compatibility

ImageGrayScale()

Full compatibility

ImageNegative()

Full compatibility

ImageOverlay()

Full compatibility

ImagePaste()

Full compatibility

ImageAddBorder()

Full compatibility

ImageScaleToFit()

Full compatibility

ImageDrawLine()

Full compatibility

ImageDrawRect()

Full compatibility

ImageDrawOval()

Full compatibility

ImageDrawText()

Full compatibility

ImageSetDrawingColor()

Full compatibility

ImageGetExifMetadata()

Full compatibility

ImageGetIPTCMetadata()

Full compatibility

ImageInfo()

Full compatibility

IsImage()

Full compatibility

IsImageFile()

Full compatibility

Member Functions

CF11+, Lucee 4.5+

Image Component

<cfimage><bx:image>

CAPTCHA

⚠️

Planned for future release

ImageFilter()

⚠️

⚠️

Planned for future release

ImageXOR()

⚠️

⚠️

Planned for future release

Legend:

  • ✅ Fully supported

  • ⚠️ Partial support or planned for future release

  • ❌ Not supported

Syntax Differences

BIF vs Member Functions

Both Adobe ColdFusion (11+) and Lucee support member function syntax. BoxLang maintains this compatibility:

Adobe CF / Lucee / BoxLang (all compatible):

No changes needed - both syntaxes work identically in BoxLang.

Component Tag Syntax

The main difference is the tag prefix:

Adobe ColdFusion / Lucee:

BoxLang:

Migration: Simple find/replace: <cfimage<bx:image

Function Mapping

Most functions have identical names and signatures between platforms:

Direct 1:1 Mappings

These functions work identically in CF, Lucee, and BoxLang:

Function
CF
Lucee
BoxLang
Notes

ImageNew()

No changes

ImageRead()

No changes

ImageWrite()

No changes

ImageResize()

No changes

ImageRotate()

No changes

ImageCrop()

No changes

ImageFlip()

No changes

ImageBlur()

No changes

ImageSharpen()

No changes

ImageGrayScale()

No changes

ImageNegative()

No changes

ImagePaste()

No changes

ImageCopy()

No changes

ImageGetWidth()

No changes

ImageGetHeight()

No changes

ImageInfo()

No changes

Parameter Differences

ImageNew()

Adobe CF:

BoxLang:

Migration: Remove empty string first parameter (optional).

ImageRotate()

All platforms support the same syntax:

No changes needed.

ImageResize()

Adobe CF / Lucee:

BoxLang:

Migration: "highestQuality""highQuality" (or use "bicubic").

Interpolation values:

Adobe CF
BoxLang
Notes

"nearest"

"nearest"

No change

"bilinear"

"bilinear"

No change

"bicubic"

"bicubic"

No change

"highestQuality"

"highQuality"

Name difference

"highQuality"

"highQuality"

No change

"mediumQuality"

"bilinear"

Use bilinear

"highestPerformance"

"nearest"

Use nearest

Component Differences

Component Name

Adobe CF / Lucee:

BoxLang:

Supported Actions

Action
CF
Lucee
BoxLang
Notes

border

No changes

captcha

⚠️

Planned

convert

No changes

info

No changes

read

No changes

resize

No changes

rotate

No changes

write

No changes

writeToBrowser

No changes

Action-Specific Attributes

Most attributes are identical across platforms:

Read:

Resize:

Write:

Known Limitations

Not Yet Implemented

These features exist in Adobe CF/Lucee but are planned for future BoxLang releases:

  1. CAPTCHA generation - <bx:image action="captcha"> not yet available

  2. ImageFilter() - Custom Java filter application

  3. ImageXOR() - XOR blending operation

  4. ImageSetAlpha() - Alpha channel manipulation (use setDrawingTransparency() as alternative)

Platform-Specific Differences

Font Rendering

Font rendering may vary slightly across platforms/OS:

Solution: Test font output on target platform, use web-safe fonts.

Color Models

BoxLang supports standard color models:

Color Model
CF
Lucee
BoxLang

RGB

ARGB

Grayscale

CMYK

⚠️

Migration: Convert CMYK images to RGB before processing.

Migration Checklist

Pre-Migration Assessment

Migration Steps

  1. Replace component tags:

  2. Update interpolation values:

  3. Test CAPTCHA alternatives: If using CAPTCHA, implement alternative until BoxLang support is added:

  4. Verify font rendering: Test text drawing on target platform:

  5. Test metadata extraction: EXIF/IPTC should work identically:

Post-Migration Testing

Common Migration Patterns

Pattern 1: Simple Resize

Adobe CF / Lucee:

BoxLang (no changes):

Pattern 2: Thumbnail with Crop

Adobe CF / Lucee:

BoxLang (no changes):

Pattern 3: Member Function Chaining

Adobe CF 11+ / Lucee 4.5+:

BoxLang (no changes):

Pattern 4: Watermarking

Adobe CF / Lucee:

BoxLang (no changes):

Pattern 5: Component Usage

Adobe CF / Lucee:

BoxLang (tag name change only):

Pattern 6: EXIF Metadata

Adobe CF / Lucee:

BoxLang (no changes):

Advanced Migration

Custom Image Processing Pipeline

Adobe CF / Lucee:

BoxLang (change interpolation only):

Batch Processing

Adobe CF / Lucee / BoxLang (identical):

Performance Considerations

Memory Usage

All platforms handle images similarly:

Optimization Tips

Same best practices apply across all platforms:

  1. Resize early: Reduce dimensions before heavy processing

  2. Reuse images: Copy instead of reloading

  3. Chain operations: Use member functions for cleaner code

  4. Format selection: Use JPEG for photos, PNG for graphics

  5. Quality settings: Balance file size vs. quality

Troubleshooting

Common Issues

Issue: "Function not found"

Cause: Typo in function name

Solution: Check function spelling (case-insensitive but verify)

Issue: "Invalid image object"

Cause: Passing variable name instead of image object

Solution: Pass actual image object

Issue: Font rendering differs

Cause: Platform/OS font differences

Solution: Use web-safe fonts, test on target platform

Additional Resources

Summary

Migration Complexity: Low

Most Adobe ColdFusion and Lucee image code will work in BoxLang with minimal or no changes:

No changes needed:

  • BIF function names and signatures

  • Member function syntax

  • Parameter order and types

  • Return values

  • EXIF/IPTC metadata extraction

  • Drawing operations

  • Color handling

⚠️ Minor changes:

  • Component tags: <cfimage><bx:image>

  • Interpolation: "highestQuality""highQuality"

Not yet available:

  • CAPTCHA generation

  • ImageFilter()

  • ImageXOR()

Migration time estimate: 1-2 hours for typical applications.

Next Steps

Last updated

Was this helpful?