Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

b64-zipped-png => JSON containing dataURLs with custom metadata objects

License

Notifications You must be signed in to change notification settings

fredrikku/dataURL-and-Meta-batch-endpoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dataURL-and-Meta-batch-endpoint

b64-zipped-png => JSON containing dataURLs with custom metadata objects

Running example can be viewed/tested through runkit (formerly tonicdev):

Why did I create this endpoint?

When making dynamic graphic intensive apps or games using a JS web-IDE, I saw a need for a convenience tools for handling bitmaps (assuming that spritsheets are less convenient and unneeded performance-wise).

API

Parameter 1: "assetURL"

A URL source responding with a b64-encoded zip, containing png files (no folders)

Parameter 2: "assetMetaDefs" (optional)

A URL source responding with JSON object containing keys "ns" which string value is used as xm-namespace. "tags" [and "attributes"] contain property keys which are used for later tag recognition.

Example

{
  "image1_background": {
    "ns": "testns",
    "tags": {
      "tagName1": {},
      "tagName2": {}
    },
    "attributes": {
      "attrName1": {},
      "attrName2": {}
    }
  }
}

Response: "assets"

A JSON object with properties "results", which contains a property for each original png-image, and a "meta" property containing another list of images with each of their metadata.

Example:

{
  "results": 
    {
      "image1_background": "data:image/png;b64,iVBORw0KGgoAAAA...",
      "image1_foreground": "data:image/png;b64,iVBORw0KGgoAAAA...",
      "meta": {
        "image1_background": {
            "tagName1": "value1",
            "tagName2": "value2"
        },
        "image1_foreground": {
            "tagName1": "value3",
            "tagName2": "value4"
        }
    }
}

Dependencies

Licensing

MIT Licence

About

b64-zipped-png => JSON containing dataURLs with custom metadata objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages