MCPcopy Create free account
hub / github.com/melonjs/melonJS / cacheEmbeddedImage

Function cacheEmbeddedImage

packages/melonjs/src/level/tiled/TMXUtils.js:20–24  ·  view source on GitHub ↗
(base64, format = "png", width, height)

Source from the content-addressed store, hash-verified

18 * @returns {string} generated filename (e.g. "__embedded_0.png")
19 */
20export function cacheEmbeddedImage(base64, format = "png", width, height) {
21 const name = `__embedded_${embeddedImageId++}`;
22 imgList[name] = decodeBase64Image(base64, format, width, height);
23 return `${name}.${format}`;
24}
25
26/**
27 * If the given data object has an embedded base64 image (JSON `imagedata`

Callers 4

tmxutils.spec.jsFile · 0.90
resolveEmbeddedImageFunction · 0.85
flattenImageFunction · 0.85
normalizeTMXFunction · 0.85

Calls 1

decodeBase64ImageFunction · 0.90

Tested by

no test coverage detected