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

get-image-data

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-image-data - npm Package Compare versions

Comparing version

to
2.1.0

14

index.js

@@ -5,4 +5,10 @@ var fs = require('fs')

module.exports = function(path, callback) {
fs.readFile(path, function(error, file) {
module.exports = function(input, callback) {
if (Buffer.isBuffer(input)) {
load(null, input)
} else {
fs.readFile(input, load)
}
function load(error, buffer) {
if (error) {

@@ -14,3 +20,3 @@ callback(error)

var image = new Canvas.Image
image.src = file
image.src = buffer

@@ -22,3 +28,3 @@ var canvas = new Canvas(

callback(null, shared(canvas)(image))
})
}
}
{
"name": "get-image-data",
"version": "2.0.0",
"version": "2.1.0",
"description": "A browser/server utility that extracts RGBA data from images.",

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

var data = require('../')
var fs = require('fs')
require('./shared')(data, {
trad: __dirname + '/images/trad.jpg',
jerry: __dirname + '/images/jerry.jpg',
astronaut: __dirname + '/images/astronaut.jpg'
fs.readFile(__dirname + '/images/astronaut.jpg', function(err, buf){
require('./shared')(data, {
trad: __dirname + '/images/trad.jpg',
jerry: __dirname + '/images/jerry.jpg',
astronaut: buf
})
})