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

canvas-operations

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-operations - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

21

index.js

@@ -6,2 +6,12 @@ 'use strict';

var canvasWidth = 28;
var canvasHeight = 28;
var canvas = new Canvas(canvasWidth, canvasHeight);
var ctx = canvas.getContext('2d');
global.CanvasRenderingContext2D = {};
global.CanvasRenderingContext2D.prototype = ctx;
require('canvas-5-polyfill');
ctx.strokeStyle = 'black';
ctx.strokeWidth = 2;
var resize = function(input) {

@@ -58,10 +68,3 @@ let pixelsArray = input.pixelsArray;

var getPixelsForStockData = function(data) {
var canvasWidth = 28;
var canvasHeight = 28;
var canvas = new Canvas(canvasWidth, canvasHeight);
var ctx = canvas.getContext('2d');
global.CanvasRenderingContext2D = {};
global.CanvasRenderingContext2D.prototype = ctx;
require('canvas-5-polyfill');
ctx.clearRect(0,0, canvasWidth, canvasHeight);
if(!data || data.length <= 0)

@@ -79,4 +82,2 @@ return [];

.interpolate('basis-open');
ctx.strokeStyle = 'black';
ctx.strokeWidth = 2;
var path = line(data);

@@ -83,0 +84,0 @@ var p = new Path2D(path);

{
"name": "canvas-operations",
"version": "2.0.2",
"version": "2.0.3",
"description": "Used to resize handwritten pixel alpha values for nueral network pattern recognition",

@@ -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