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

@applitools/image

Package Overview
Dependencies
Maintainers
33
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@applitools/image - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

15

dist/image.js

@@ -35,2 +35,3 @@ "use strict";

const jpeg = __importStar(require("jpeg-js"));
const bmp = __importStar(require("bmpimagejs"));
const utils = __importStar(require("@applitools/utils"));

@@ -55,2 +56,6 @@ function makeImage(data) {

}
else if (isBmpBuffer(data)) {
image = fromBmpBuffer(data);
size = extractBmpSize(data);
}
else {

@@ -204,2 +209,5 @@ throw new Error('Unable to create an image abstraction from buffer with unknown data');

}
function isBmpBuffer(buffer) {
return buffer.slice(0, 2).toString('ascii') === 'BM';
}
function extractPngSize(buffer) {

@@ -224,2 +232,5 @@ return { width: buffer.readUInt32BE(16), height: buffer.readUInt32BE(20) };

}
function extractBmpSize(buffer) {
return { width: buffer.readUInt32LE(18), height: buffer.readUInt32LE(22) };
}
function fromSize(size) {

@@ -241,2 +252,6 @@ return new png.Image({ width: size.width, height: size.height });

}
async function fromBmpBuffer(buffer) {
const image = bmp.decode(buffer);
return { data: Buffer.from(image.pixels), width: image.width, height: image.height };
}
async function toPng(image) {

@@ -243,0 +258,0 @@ return new Promise((resolve, reject) => {

8

package.json
{
"name": "@applitools/image",
"version": "1.0.5",
"version": "1.0.6",
"description": "Image primitive used for capturing and manipulating screenshots",

@@ -47,3 +47,4 @@ "homepage": "https://applitools.com",

"dependencies": {
"@applitools/utils": "1.3.13",
"@applitools/utils": "1.3.14",
"bmpimagejs": "1.0.4",
"jpeg-js": "0.4.4",

@@ -55,2 +56,3 @@ "png-async": "0.9.4"

"@applitools/scripts": "^1.2.0",
"@types/bmp-js": "^0.1.0",
"@types/mocha": "^9.1.1",

@@ -70,3 +72,3 @@ "@types/node": "12",

"ts-node": "^10.2.1",
"typescript": "^4.6.4"
"typescript": "^4.8.4"
},

@@ -73,0 +75,0 @@ "engines": {

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