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.4 to 1.3.5

27

index.js

@@ -72,6 +72,8 @@ "use strict";

const backgroundSource = options.backgroundImage == "" ? [] : [options.backgroundImage]
const hasBackgroundImage = options.backgroundImage == "";
const backgroundSource = hasBackgroundImage ? [] : [options.backgroundImage];
const sources = backgroundSource.concat(options.sources);
let maxImages = options.width * options.height;
if(hasBackgroundImage) maxImages++;

@@ -81,8 +83,3 @@ return Promise

.each((photoBuffer, i) => {
if (options.backgroundImage != "") {
if (i - 1 >= maxImages) return;
} else {
if (i >= maxImages) return;
}
if (i >= maxImages) return;

@@ -92,16 +89,8 @@ const img = new Image();

// if (options.backgroundImage != "") {
// if (i == 0) {
// // draw background
// ctx.drawImage(img, 0, 0, canvasWidth, canvasHeight)
// } else {
// i--; // offset for first image
// }
// } else {
// }
if (i == 0 && options.backgroundImage != "") {
// draw background image if present
if (hasBackgroundImage && i == 0) {
ctx.drawImage(img, 0, 0, canvasWidth, canvasHeight)
} else {
// offset for background
if (hasBackgroundImage) i--;
const x = (i % options.width) * (options.imageWidth + options.spacing);

@@ -108,0 +97,0 @@ const y = Math.floor(i / options.width) * (options.imageHeight + options.spacing);

{
"name": "nf-photo-collage",
"version": "1.3.4",
"version": "1.3.5",
"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