Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spritesmith

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spritesmith - npm Package Compare versions

Comparing version 0.3.8 to 0.3.9

2

package.json
{
"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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc