Animate. Embed Images
Module for Adobe Animate that inserts image assets inside js file
Helpful stuff when you need to get single html without external files. Maybe some day Adobe will add this feature.
Installation
npm install animate-embed-images
Output example (part of...)
libproperties = width: 300 height: 500 fps: 24 color: "#FFFFFF" opacity: 100 webfonts: {} manifest: type:createjsAbstractLoaderIMAGE src:"data:image/png;base64, ... " id:"Bitmap1" type:createjsAbstractLoaderIMAGE src:"data:image/png;base64, ... " id:"Bitmap2" type:createjsAbstractLoaderIMAGE src:"data:image/jpg;base64, ... " id:"Bitmap3" preloads: ;
Usage
const path = ;const glob = ;const chalk = ;const table getBorderCharacters = ;const AnimateEmbedImages = ; ;
Callback data structure:
{ status -> {String} 'ok' or 'fail' message -> {String} Any text describing status input_file -> {String} Source js file path output_file -> {String} Output js file path js_content -> {String} Modified js content images: [ { name -> {String} Image file name path -> {String} Image path exist -> {Number} 0 - if image does not exist size -> {Number} Image file size (bytes) b64_size -> {Number} The size of the image in base64 format (bytes) } ]}
Changelog
2018-01-17:
- Removed images sorting. That was just for cosmetic purposes at the debug stage.