Skip to content

Instantly share code, notes, and snippets.

@ghengeveld
Created October 7, 2015 11:39
Show Gist options
  • Save ghengeveld/63226a1b62f8f00f9277 to your computer and use it in GitHub Desktop.
Save ghengeveld/63226a1b62f8f00f9277 to your computer and use it in GitHub Desktop.
function embed(data, sizes) {
const formattedData = {};
for (let uuid in sizes) {
if (sizes.hasOwnProperty(uuid) && data[uuid]) {
formattedData[uuid] = {
name: uuid,
w: sizes[uuid].width,
h: sizes[uuid].height,
vars: {
id: data[uuid],
autoScale: true,
forceTransform: true
}
};
}
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment