imageWriteBase64

Writes Base64 images to the specified filename and destination.

imageWriteBase64(name, destination, format [, inHTMLFormat] [, overwrite]) → returns void

Member Function Syntax

someImage.writeBase64(destination, format [, inHTMLFormat] [, overwrite])

Argument Reference

name string
Required

The image on which this operation is performed.

destination string
Required

The path for the destination file.

format string
Required

the image format

inHTMLFormat boolean
Default: false

Specify whether Base64 output includes the headers used by the Base64 images in the HTML 'img' tag ('data:image/{format};base64,...')
Values:
  • false
  • true

overwrite boolean
Default: true

If set to true, overwrites the destination file.
Values:
  • false
  • true

Examples
Sample code invoking the imageWriteBase64 function

CF 11+ Write a base64 representation of an image

imgObj = imageNew("",152,152,"rgb","149c82");
imgObj.writeBase64('base64.txt','jpg');

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub