Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using the data URI scheme in MTML. https://github.com/alfasado/mt-plugin-asset2base64
<mt:Asset id="1">
<mt:AssetThumbnailFile width="32" square="1" convert2base64="1" setvar="src">
<mt:Var name="src" get_content_length="1" setvar="image_size">
<mt:If name="image_size" lt="32768">
<img src="data:<mt:AssetMimeType>;base64,<mt:Var name="src">" width="32" height="32" alt="<mt:AssetLabel escape="html">" />
<mt:else>
<img src="<mt:AssetThumbnailURL>" width="32" height="32" alt="<mt:AssetLabel escape="html">" />
</mt:If>
</mt:Asset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment