This component relies on external JavaScript libraries that must be loaded before any conversion can take place.
Open the Screen or Block where you intend to perform the image conversion.
Drag the Heic2AnyLoader web block from the widget tree and drop it anywhere on your screen (usually at the bottom or top of the widget tree).
Heic2AnyLoader
Note: This block is invisible at runtime but is required for the Client Actions to function.
How to Use
1. Detecting a HEIC File
Don't rely on file extensions (like .heic), as they can be misleading. Use the built-in detection logic.
.heic
In your logic flow (e.g., the On Change event of an Upload Widget), verify you have the Binary Data of the file.
Call the Client Action IsHEIC.
IsHEIC
Input: Pass the FileBinaryData.
FileBinaryData
Output: Returns a Boolean (IsHEIC).
This action checks the "magic bytes" (file signature) to confirm it is truly a HEIC file.
2. Converting the Image
If IsHEIC returns True, proceed to convert the file to a browser-compatible format (PNG).
Call the Client Action ConvertImage.
ConvertImage
Input: HEICFileBinaryData (Binary Data).
HEICFileBinaryData
Input: Quality (Optional Decimal, 0.0 to 1.0. Default is 0.8).
Quality
The action will return two Text outputs:
ConvertedImage: The full Data URL. Bind this directly to an Image Widget (Type: External URL) for immediate preview.
ConvertedImage
ConvertedImage_PureBase64: The raw Base64 string without headers. Use this if you need to convert back to Binary Data (server-side) for database storage.
ConvertedImage_PureBase64
Example Flow (Upload & Preview)
UI: Add an Upload Widget and an Image Widget.
Logic: In the On Change action of the Upload Widget:
On Change
Step A: Call IsHEIC(Upload1.Content).
IsHEIC(Upload1.Content)
Step B: Add an If node checking IsHEIC.IsHEIC.
IsHEIC.IsHEIC
True Branch: Call ConvertImage. Assign the output ConvertedImage to your local variable bound to the Image Widget.
False Branch: Assign the original content (Upload1.Content) to your local variable (use BinaryToBase64 if using External URL source).
Upload1.Content
BinaryToBase64