Skip to content

Instantly share code, notes, and snippets.

@alfasado
Last active December 13, 2015 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfasado/4951277 to your computer and use it in GitHub Desktop.
Save alfasado/4951277 to your computer and use it in GitHub Desktop.
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