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

jimp

Package Overview
Dependencies
Maintainers
1
Versions
281
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jimp - npm Package Compare versions

Comparing version 0.2.18 to 0.2.19

2

example.js

@@ -1,2 +0,2 @@

var Jimp = require("./index.js");
var Jimp = require("jimp");

@@ -3,0 +3,0 @@ var url = "https://upload.wikimedia.org/wikipedia/commons/0/01/Bot-Test.jpg";

@@ -659,2 +659,9 @@ var FS = require("fs");

// an array storing the maximum string length of hashes at various bases
var maxHashLength = [];
for (var i = 0; i < 65; i++) {
var l = (i > 1) ? (new BigNumber(Array(64 + 1).join("1"), 2)).toString(i) : NaN;
maxHashLength.push(l.length);
}
/**

@@ -678,6 +685,10 @@ * Generates a perceptual hash of the image <https://en.wikipedia.org/wiki/Perceptual_hashing>.

var hash = (new ImagePHash()).getHash(this);
var base64 = (new BigNumber(hash, 2)).toString(base);
hash = (new BigNumber(hash, 2)).toString(base);
if (isNodePattern(cb)) return cb.call(this, null, base64);
else return base64;
while (hash.length < maxHashLength[base]) {
hash = "0" + hash; // pad out with leading zeros
}
if (isNodePattern(cb)) return cb.call(this, null, hash);
else return hash;
}

@@ -684,0 +695,0 @@

{
"name": "jimp",
"version": "0.2.18",
"version": "0.2.19",
"description": "An image processing library written entirely in JavaScript (i.e. zero external or native dependencies).",

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

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