Skip to content

New function base64.encode.asset - #6020

Open
Baaaaaz wants to merge 2 commits into
RPTools:developfrom
Baaaaaz:feature/2981-base64-encode-asset
Open

New function base64.encode.asset#6020
Baaaaaz wants to merge 2 commits into
RPTools:developfrom
Baaaaaz:feature/2981-base64-encode-asset

Conversation

@Baaaaaz

@Baaaaaz Baaaaaz commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Identify the Bug or Feature request

closes #2981

Description of the Change

new MT script function base64.encode.asset

Possible Drawbacks

Currently only does assets that are images.
No equivalent decode function provided as either natively handled in html (but webview performance on doing this sucks), or decoding could/should be handled via the createAsset() function instead (which may need to be adjusted to handle data URI prefixes).

Documentation Notes

new MT script function``base64.encode.asset` for converting asset images to base64, params are:

  1. asset id
  2. optional true/false add data URI prefix (default=false) i.e. "data:MIME type/MIME subtype;base64,"

Release Notes

New base64.encode.asset function


This change is Reviewable

@github-actions github-actions Bot added the feature Adding functionality that adds value label Aug 1, 2026

@kwvanderlinde kwvanderlinde left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Would be nice to extend this to all assets, but I think we need a bit of extra work first on the asset management side. E.g., have Asset keep track of its detected media type so it can be used in base64.encode.asset regardless of type.

@kwvanderlinde kwvanderlinde moved this from Todo to To-Be-Merged in MapTool 1.19 Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Adding functionality that adds value

Projects

Status: To-Be-Merged

Development

Successfully merging this pull request may close these issues.

Way to get raw image data of an asset

2 participants