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

node-js-image

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-js-image - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

package.json
{
"name": "node-js-image",
"version": "0.0.2",
"version": "0.0.3",
"description": "Manipulate Images in Node.js",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -9,2 +9,11 @@ const fs = require('fs')

/**
* @typedef { object } InitValues Three Dimensional Array
* @property { Array1D } data
* @property { number } width
* @property { number } height
* @property { number } channels
* @property { number[] } shape
*/
/**
* @typedef {object} Options

@@ -72,8 +81,10 @@ * @property {string} [fname]

if (this.options && this.options.fname) {
this.fromFile(this.options.fname)
}
if (this.options) {
if (this.options.fname) {
this.fromFile(this.options.fname)
}
if (this.options && this.options.buffer) {
this.fromBuffer(this.options.buffer)
if (this.options.buffer) {
this.fromBuffer(this.options.buffer)
}
}

@@ -101,2 +112,11 @@ }

this.shape = [this.width, this.height, this.channels]
/** @type { InitValues } */
this._initValues = {
data: this.data,
width: this.width,
height: this.height,
channels: this.channels,
shape: this.shape
}
return this

@@ -271,2 +291,6 @@ }

/**
* Rotate the Image clockwise by 90°
* @returns { Image }
*/
rotate () {

@@ -299,2 +323,18 @@ if (this.isFlat) { this.pixels() }

/**
* Restore the Inital Image Values
* @returns { Image }
*/
restore () {
const initValues = this._initValues
if (initValues) {
this.data = initValues.data
this.width = initValues.width
this.height = initValues.height
this.channels = initValues.channels
this.shape = initValues.shape
}
return this
}
/**
* Helper Method for the Image Processing Methods

@@ -301,0 +341,0 @@ * @private

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