Socket
Socket
Sign inDemoInstall

image-filter-core

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-filter-core - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

sandbox/dummy.jpg

1

karma.conf.js

@@ -43,3 +43,2 @@ var istanbul = require('istanbul');

debug: true,
plugin: ['proxyquire-universal'],
transform: [

@@ -46,0 +45,0 @@ bistanbul({

{
"name": "image-filter-core",
"version": "2.0.1",
"version": "2.0.2",
"description": "Core module for image-filter",

@@ -9,2 +9,3 @@ "main": "src/index.js",

"test": "karma start",
"build": "npm run eslint && browserify sandbox/sandbox.js > sandbox/bundle.js",
"codecov": "cat coverage/*/lcov.info | codecov",

@@ -47,7 +48,3 @@ "serve": "http-server sandbox"

"phantomjs-prebuilt": "^2.1.5",
"proxyquire": "^1.7.10",
"proxyquire-universal": "^1.0.8",
"proxyquireify": "^3.2.1",
"sinon": "^1.17.3",
"watchify": "^3.7.0"
"sinon": "^1.17.3"
},

@@ -54,0 +51,0 @@ "dependencies": {

![build status](https://travis-ci.org/canastro/image-filter-threshold.svg?branch=master)
[![Dependency Status](https://dependencyci.com/github/canastro/image-filter-core/badge)](https://dependencyci.com/github/canastro/image-filter-core)
[![npm version](https://badge.fury.io/js/image-filter-threshold.svg)](https://badge.fury.io/js/image-filter-threshold)

@@ -3,0 +4,0 @@ [![codecov](https://codecov.io/gh/canastro/image-filter-core/branch/master/graph/badge.svg)](https://codecov.io/gh/canastro/image-filter-core)

@@ -88,4 +88,2 @@ require('es6-promise/auto');

var finished = 0;
var len = canvas.width * canvas.height * 4;
var segmentLength;
var blockSize;

@@ -101,8 +99,12 @@

segmentLength = len / nWorkers; // This is the length of array sent to the worker
blockSize = canvas.height / nWorkers; // Height of the picture chunck for every worker
// Height of the picture chunck for every worker
blockSize = Math.floor(canvas.height / nWorkers);
return new Promise(function (resolve) {
var w;
var height;
var canvasData;
for (var index = 0; index < nWorkers; index++) {
var w = new Worker(workerURL);
w = new Worker(workerURL);

@@ -125,4 +127,10 @@ w.addEventListener('message', function (e) {

// In the last worker we have to make sure we process whatever is missing
height = blockSize;
if ((index + 1) === nWorkers) {
height = canvas.height - (blockSize * index);
}
// Getting the picture
var canvasData = context.getImageData(0, blockSize * index, canvas.width, blockSize);
canvasData = context.getImageData(0, blockSize * index, canvas.width, height);

@@ -133,3 +141,3 @@ // Sending canvas data to the worker using a copy memory operation

index: index,
length: segmentLength,
length: height * canvas.width * 4,
options: options,

@@ -136,0 +144,0 @@ transformationURL: transformationURL

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