spritesmith
Advanced tools
Comparing version 0.3.8 to 0.3.9
{ | ||
"name": "spritesmith", | ||
"version": "0.3.8", | ||
"version": "0.3.9", | ||
"description": "Utility that takes images and creates a spritesheet with JSON sprite data", | ||
@@ -5,0 +5,0 @@ "main": "src/smith.js", |
@@ -30,2 +30,4 @@ Spritesmith | ||
This module has been developed and tested against `1.3.17`. | ||
Documentation | ||
@@ -32,0 +34,0 @@ ------------- |
@@ -52,3 +52,3 @@ var smith = require('../src/smith.js'), | ||
// Attempt to smith out the sprites | ||
smith({'src': sprites, 'algorithm': 'left-right', 'engine': 'gm'}, function (err, result) { | ||
smith({'src': sprites, 'algorithm': 'left-right'}, function (err, result) { | ||
// If there is an error, throw it | ||
@@ -55,0 +55,0 @@ if (err) { |
@@ -89,12 +89,17 @@ var async = require('async'), | ||
function generateCanvas (cb) { | ||
// Generate a canvas | ||
var width = packedObj.width, | ||
height = packedObj.height; | ||
engine.createCanvas(width, height, cb); | ||
// If there are items, generate the canvas | ||
if (packedObj.items.length) { | ||
var width = packedObj.width, | ||
height = packedObj.height; | ||
engine.createCanvas(width, height, cb); | ||
} else { | ||
// Otherwise, skip over potential errors/CPU | ||
cb(null, ''); | ||
} | ||
}, | ||
// Then, export the canvas | ||
function exportCanvas (canvas, cb) { | ||
// If there are no items to pack, skip export | ||
// If there is no canvas, callback with an empty string | ||
var items = packedObj.items; | ||
if (items.length === 0) { | ||
if (!canvas) { | ||
return cb(null, ''); | ||
@@ -101,0 +106,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
101
0
79236
25
741
1