New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.16.0 to 0.17.0

2

CHANGELOG.md
# spritesmith changelog
0.17.0 - Added `pngsmith` as an engine, allowing external dependency-free installation
0.16.0 - Moved to `canvassmith@0.2.0` for `giflib` support

@@ -3,0 +5,0 @@

5

package.json
{
"name": "spritesmith",
"version": "0.16.0",
"version": "0.17.0",
"description": "Utility that takes images and creates a spritesheet with JSON sprite data",

@@ -28,3 +28,4 @@ "main": "src/smith.js",

"gmsmith": "~0.3.0",
"canvassmith": "~0.2.0"
"canvassmith": "~0.2.0",
"pngsmith": "~0.1.0"
},

@@ -31,0 +32,0 @@ "repository": {

@@ -34,3 +34,4 @@ # Spritesmith

* @param {String[]} [params.src] Images to generate into sprite sheet
* @param {String} [params.engine="auto"] Engine to use (phantomjs, canvas, gm, or user-defined via Spritesmith.addEngine)
* @param {String} [params.engine="auto"] Engine to use
(phantomjs, canvas, gm, pngsmith or user-defined via Spritesmith.addEngine)
* @param {String} [params.algorithm="top-down"] Algorithm to pack images with

@@ -97,6 +98,11 @@ * @param {Number} [params.padding] Padding to use between images

### pngsmith
The `pngsmith` engine uses [`pngparse`][], an JavaScript `png` parser, to interpret images into [`ndarrays`][]. This requires no additional steps before installation.
**Key differences:** It requires no additional installation steps but you are limited to `.png` files for your source files.
### phantomjs
The `phantomjs` engine relies on having [phantomjs][] installed on your machine. Visit [the phantomjs website][phantomjs] for installation instructions.
**Key differences:** `phantomjs` is the most accessible engine.
**Key differences:** `phantomjs` is the easiest engine to install that supports all image formats.

@@ -103,0 +109,0 @@ `spritesmith` has been tested against `phantomjs@1.9.0`.

@@ -82,4 +82,3 @@ // Load in modules and set up routes

// DEV: Write out to actual_files
// if (true) {
if (false) {
if (process.env.TEST_DEBUG) {
try { fs.mkdirSync(__dirname + '/actual_files'); } catch (e) {}

@@ -104,4 +103,3 @@ fs.writeFileSync(__dirname + '/actual_files/' + this.namespace + 'sprite.png', this.result.image, 'binary');

// DEV: Write out to actual_files
if (true) {
// if (false) {
if (process.env.TEST_DEBUG) {
try { fs.mkdirSync(__dirname + '/actual_files'); } catch (e) {}

@@ -108,0 +106,0 @@ fs.writeFileSync(__dirname + '/actual_files/' + namespace + 'sprite.png', result.image, 'binary');

@@ -13,3 +13,3 @@ var async = require('async'),

* @param {String[]} [params.src] Images to generate into sprite sheet
* @param {String} [params.engine="auto"] Engine to use (phantomjs, canvas, gm, or user-defined via Spritesmith.addEngine)
* @param {String} [params.engine="auto"] Engine to use (phantomjs, canvas, gm, pngsmith, or user-defined via Spritesmith.addEngine)
* @param {String} [params.algorithm="top-down"] Algorithm to pack images with (top-down or user-defined via Spritesmith.addAlgorithm)

@@ -36,4 +36,4 @@ * @param {Number} [params.padding] Padding to use between images

// Begin attempting to load the engines
engine = engines.phantomjs || engines.canvas || engines.gm;
// Begin attempting to load the engines (in order of hardest to easiest)
engine = engines.canvas || engines.gm || engines.phantomjs || engine['png-engine'];

@@ -182,3 +182,4 @@ // Assert there is an engine

gmEngine,
phantomjsEngine;
phantomjsEngine,
pngEngine;
try {

@@ -196,7 +197,12 @@ canvasEngine = require('canvassmith');

try {
pngEngine = require('pngsmith');
} catch (e) {}
if (canvasEngine) { addEngine('canvas', canvasEngine); }
if (gmEngine) { addEngine('gm', gmEngine); }
if (phantomjsEngine) { addEngine('phantomjs', phantomjsEngine); }
if (pngEngine) { addEngine('pngsmith', pngEngine); }
// Export Spritesmith
module.exports = Spritesmith;

Sorry, the diff of this file is not supported yet

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