Socket
Socket
Sign inDemoInstall

nf-photo-collage

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nf-photo-collage - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

31

index.js

@@ -69,15 +69,8 @@ "use strict";

if(options.backgroundImage != "") {
const bckgBuffer = getPhoto(options.backgroundImage);
bckgBuffer.then((bckg) => {
const image = new Image();
image.src = bckg;
ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight)
})
} else {
ctx.fillStyle = options.backgroundColor;
ctx.fillRect(0, 0, canvasWidth, canvasHeight);
}
ctx.fillStyle = options.backgroundColor;
ctx.fillRect(0, 0, canvasWidth, canvasHeight);
const sources = options.sources;
const backgroundSource = options.backgroundImage == "" ? [] : [options.backgroundImage]
const sources = backgroundSource.concat(options.sources);
let maxImages = options.width * options.height;

@@ -89,9 +82,13 @@

if (i >= maxImages) return;
const img = new Image();
img.src = photoBuffer;
const x = (i % options.width) * (options.imageWidth + options.spacing);
const y = Math.floor(i / options.width) * (options.imageHeight + options.spacing);
ctx.drawImage(img, x, y, options.imageWidth, options.imageHeight);
if (i == 0 && options.backgroundImage != "") {
// draw background
ctx.drawImage(img, 0, 0, canvasWidth, canvasHeight)
} else {
const x = (i % options.width) * (options.imageWidth + options.spacing);
const y = Math.floor(i / options.width) * (options.imageHeight + options.spacing);
ctx.drawImage(img, x, y, options.imageWidth, options.imageHeight);
}
})

@@ -98,0 +95,0 @@ .then(() => {})

{
"name": "nf-photo-collage",
"version": "1.3.2",
"version": "1.3.3",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

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