New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pngjs-image

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pngjs-image - npm Package Compare versions

Comparing version 0.11.0 to 0.11.1

lib/modify.js

5

CHANGELOG.md
CHANGELOG
=========
v0.11.1 - 04/20/15
* Add rotateCW/rotateCCW methods
* Add experimental feature
* Add synchronous PNG loader (readImageSync)
v0.11.0 - 04/19/15

@@ -5,0 +10,0 @@ * Add experimental features:

@@ -8,2 +8,3 @@ // Copyright 2014-2015, Yahoo! Inc.

pixel = require('./lib/pixel'),
modify = require('./lib/modify'),
conversion = require('./lib/conversion'),

@@ -82,2 +83,3 @@ filters = require('./lib/filters'),

/**

@@ -97,2 +99,3 @@ * Copies an already existing image

/**

@@ -127,2 +130,15 @@ * Reads an image from the filesystem

/**
* Reads an image from the filesystem synchronously
*
* @static
* @method readImageSync
* @param {string} filename
* @return {PNGImage}
*/
PNGImage.readImageSync = function (filename) {
return this.loadImageSync(fs.readFileSync(filename));
};
/**
* Loads an image from a blob

@@ -422,2 +438,3 @@ *

_.extend(PNGImage.prototype, pixel);
_.extend(PNGImage.prototype, modify);
_.extend(PNGImage.prototype, conversion);

@@ -424,0 +441,0 @@

17

lib/pixel.js

@@ -55,3 +55,3 @@ // Copyright 2014-2015 Yahoo! Inc.

* @param {int} idx Index of pixel
* @param {object} color
* @param {object|int} color
* @param {int} [color.red] Red value for pixel

@@ -64,6 +64,13 @@ * @param {int} [color.green] Green value for pixel

setAtIndex: function (idx, color) {
if (color.red !== undefined) this.setRed(idx, color.red, color.opacity);
if (color.green !== undefined) this.setGreen(idx, color.green, color.opacity);
if (color.blue !== undefined) this.setBlue(idx, color.blue, color.opacity);
if (color.alpha !== undefined) this.setAlpha(idx, color.alpha, color.opacity);
if (typeof color === 'object') {
if (color.red !== undefined) this.setRed(idx, color.red, color.opacity);
if (color.green !== undefined) this.setGreen(idx, color.green, color.opacity);
if (color.blue !== undefined) this.setBlue(idx, color.blue, color.opacity);
if (color.alpha !== undefined) this.setAlpha(idx, color.alpha, color.opacity);
} else {
this.setRed(idx, color & 0xff);
this.setGreen(idx, (color & 0xff00) >> 8);
this.setBlue(idx, (color & 0xff0000) >> 16);
this.setAlpha(idx, (color & 0xff000000) >> 24);
}
},

@@ -70,0 +77,0 @@

{
"name": "pngjs-image",
"version": "0.11.0",
"version": "0.11.1",
"description": "Native PNG image manipulation",

@@ -5,0 +5,0 @@ "license": "MIT",

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