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

images

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

images - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

test/runAllTest.js

56

package.json
{
"name": "images",
"version": "1.0.0",
"description": "Cross-platform image decoder(png/jpeg/gif) and encoder(png) for Nodejs",
"main": "index.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "node test/drawImage.js",
"install": "node install.js"
},
"repository": {
"type": "git",
"url": "https://github.com/zhangyuanwei/node-images.git"
},
"keywords": [
"image",
"decoder",
"encoder",
"png",
"jpeg",
"gif",
"cross-platform",
"images"
],
"author": "ZhangYuanwei <zhangyuanwei1988@gmail.com>",
"license": "BSD",
"gypfile": true,
"readmeFilename": "README.md",
"gitHead": "9921ad4313ba247e60d3dc9f57f80cc40b629f9a"
"name": "images",
"version": "1.0.1",
"description": "Cross-platform image decoder(png/jpeg/gif) and encoder(png) for Nodejs",
"main": "index.js",
"scripts": {
"test": "node test/runAllTest.js",
"install": "node install.js"
},
"repository": {
"type": "git",
"url": "https://github.com/zhangyuanwei/node-images.git"
},
"keywords": [
"image",
"decoder",
"encoder",
"png",
"jpeg",
"gif",
"cross-platform",
"images"],
"author": "ZhangYuanwei <zhangyuanwei1988@gmail.com>",
"license": "BSD",
"gypfile": true,
"readmeFilename": "README.md",
"gitHead": "9921ad4313ba247e60d3dc9f57f80cc40b629f9a"
}

@@ -25,14 +25,21 @@ node-images

### loadFromBuffer(buffer[, start, [end]]);
See `test/loadFromBuffer.js`
### copyFromImage(x, y, width, height);
See `test/copyFromImage.js`
### fillColor(red, green, blue[, alpha]);
See `test/fillColor.js`
### drawImage(img, x, y);
See `test/drawImage.js`
### toBuffer(type);
See `test/toBuffer.js`
### width
*readonly*
### height
*readonly*
var fs = require("fs"),
images = require("../index");
images = require(__dirname + "/../index");

@@ -13,3 +13,3 @@ var srcImg = new images.Image(),

srcData = fs.readFileSync("img/PNG_transparency_demonstration.png");
srcData = fs.readFileSync(__dirname + "/img/PNG_transparency_demonstration.png");

@@ -22,2 +22,2 @@ srcImg.loadFromBuffer(srcData);

fs.writeFileSync("output/copyFromImage.png", dstData);
fs.writeFileSync(__dirname + "/output/copyFromImage.png", dstData);
var fs = require("fs"),
images = require("../index");
images = require(__dirname + "/../index");
var img1 = new images.Image(),
img2 = new images.Image(),
img3 = new images.Image(),
img4 = new images.Image(),
dstImg,
x, y, width, height,
srcData, dstData;
img2 = new images.Image(),
img3 = new images.Image(),
img4 = new images.Image(),
dstImg,
x, y, width, height,
srcData, dstData;
img1.loadFromBuffer(fs.readFileSync("img/JPEG_example_donkey_010.jpg"));
img2.loadFromBuffer(fs.readFileSync("img/JPEG_example_donkey_050.jpg"));
img3.loadFromBuffer(fs.readFileSync("img/JPEG_example_donkey_100.jpg"));
img4.loadFromBuffer(fs.readFileSync("img/PNG_transparency_demonstration.png"));
img1.loadFromBuffer(fs.readFileSync(__dirname + "/img/JPEG_example_donkey_010.jpg"));
img2.loadFromBuffer(fs.readFileSync(__dirname + "/img/JPEG_example_donkey_050.jpg"));
img3.loadFromBuffer(fs.readFileSync(__dirname + "/img/JPEG_example_donkey_100.jpg"));
img4.loadFromBuffer(fs.readFileSync(__dirname + "/img/PNG_transparency_demonstration.png"));

@@ -33,2 +33,2 @@ width = img1.width + img2.width + img3.width;

fs.writeFileSync("output/drawImage.png", dstImg.toBuffer(images.TYPE_PNG));
fs.writeFileSync(__dirname + "/output/drawImage.png", dstImg.toBuffer(images.TYPE_PNG));
var fs = require("fs"),
images = require("../index");
images = require(__dirname + "/../index");

@@ -10,3 +10,3 @@ var background, picture,

picture = new images.Image();
picture.loadFromBuffer(fs.readFileSync("img/PNG_transparency_demonstration.png"));
picture.loadFromBuffer(fs.readFileSync(__dirname + "/img/PNG_transparency_demonstration.png"));

@@ -18,2 +18,2 @@ background = new images.Image(picture.width, picture.height);

fs.writeFileSync("output/fillColor.png", background.toBuffer(images.TYPE_PNG));
fs.writeFileSync(__dirname + "/output/fillColor.png", background.toBuffer(images.TYPE_PNG));
var path = require("path"),
fs = require("fs"),
images = require("../index");
images = require(__dirname + "/../index");
var DIR = "img";
var DIR = __dirname + "/img";

@@ -7,0 +7,0 @@ fs.readdir(DIR, function(err, items) {

var fs = require("fs"),
images = require("../index");
images = require(__dirname + "/../index");

@@ -7,3 +7,3 @@ var img;

img = new images.Image();
img.loadFromBuffer(fs.readFileSync("img/rotating_earth.gif"));
fs.writeFileSync("output/toBuffer.png", img.toBuffer(images.TYPE_PNG));
img.loadFromBuffer(fs.readFileSync(__dirname + "/img/rotating_earth.gif"));
fs.writeFileSync(__dirname + "/output/toBuffer.png", img.toBuffer(images.TYPE_PNG));

Sorry, the diff of this file is not supported yet

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