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

merge-images

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

merge-images - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

10

dist/index.es2015.js

@@ -21,6 +21,3 @@ // Defaults

var canvas = options.Canvas ? new options.Canvas() : window.document.createElement('canvas');
var Image = options.Canvas ? options.Canvas.Image : window.Image;
if (options.Canvas) {
options.quality *= 100;
}
var Image = options.Image || window.Image;

@@ -61,3 +58,3 @@ // Load sources

// Resolve data URI for node-canvas jpeg async
return new Promise(function (resolve) {
return new Promise(function (resolve, reject) {
canvas.toDataURL(options.format, {

@@ -68,3 +65,4 @@ quality: options.quality,

if (err) {
throw err;
reject(err);
return;
}

@@ -71,0 +69,0 @@ resolve(jpeg);

@@ -27,6 +27,3 @@ (function (global, factory) {

var canvas = options.Canvas ? new options.Canvas() : window.document.createElement('canvas');
var Image = options.Canvas ? options.Canvas.Image : window.Image;
if (options.Canvas) {
options.quality *= 100;
}
var Image = options.Image || window.Image;

@@ -67,3 +64,3 @@ // Load sources

// Resolve data URI for node-canvas jpeg async
return new Promise(function (resolve) {
return new Promise(function (resolve, reject) {
canvas.toDataURL(options.format, {

@@ -74,3 +71,4 @@ quality: options.quality,

if (err) {
throw err;
reject(err);
return;
}

@@ -77,0 +75,0 @@ resolve(jpeg);

4

package.json
{
"name": "merge-images",
"version": "1.2.0",
"version": "2.0.0",
"description": "Easily compose images together without messing around with canvas",

@@ -46,3 +46,3 @@ "main": "dist/index.umd.js",

"camelcase": "^5.0.0",
"canvas": "^1.6.2",
"canvas": "^2.6.1",
"coveralls": "^3.0.0",

@@ -49,0 +49,0 @@ "datauri": "^1.0.5",

@@ -105,6 +105,7 @@ # merge-images

const mergeImages = require('merge-images');
const Canvas = require('canvas');
const { Canvas, Image } = require('canvas');
mergeImages(['./body.png', './eyes.png', './mouth.png'], {
Canvas: Canvas
Canvas: Canvas,
Image: Image
})

@@ -111,0 +112,0 @@ .then(b64 => ...);

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