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

@thumbmarkjs/thumbmarkjs

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

@thumbmarkjs/thumbmarkjs - npm Package Compare versions

Comparing version 0.12.3 to 0.12.4

32

dist/components/webgl/webgl.js

@@ -42,15 +42,15 @@ "use strict";

var commonPixels_1 = require("../../utils/commonPixels");
var canvas = document.createElement('canvas');
canvas.width = 200;
canvas.height = 100;
var gl = canvas.getContext('webgl');
function createWebGLFingerprint() {
return __awaiter(this, void 0, void 0, function () {
var canvas, gl, imageDatas, commonImageData;
var imageDatas, commonImageData;
return __generator(this, function (_a) {
try {
canvas = document.createElement('canvas');
canvas.width = 200;
canvas.height = 100;
gl = canvas.getContext('webgl');
if (!gl) {
throw new Error('WebGL not supported');
}
imageDatas = Array.from({ length: 3 }, function () { return createWebGLImageData(); });
imageDatas = Array.from({ length: 1 }, function () { return createWebGLImageData(); });
commonImageData = (0, commonPixels_1.getCommonPixels)(imageDatas, canvas.width, canvas.height);

@@ -76,8 +76,3 @@ //const imageData = createWebGLImageData()

function createWebGLImageData() {
var gl = null;
try {
var canvas = document.createElement('canvas');
canvas.width = 200;
canvas.height = 100;
gl = canvas.getContext('webgl');
if (!gl) {

@@ -140,8 +135,2 @@ throw new Error('WebGL not supported');

var imageData = new ImageData(pixelData, canvas.width, canvas.height);
// WebGL cleanup
gl.disableVertexAttribArray(positionAttribute);
gl.deleteBuffer(vertexBuffer);
gl.deleteProgram(shaderProgram);
gl.deleteShader(vertexShader);
gl.deleteShader(fragmentShader);
return imageData;

@@ -155,6 +144,7 @@ }

if (gl) {
var loseContextExtension = gl.getExtension('WEBGL_lose_context');
if (loseContextExtension) {
loseContextExtension.loseContext();
}
// Reset WebGL state
gl.bindBuffer(gl.ARRAY_BUFFER, null);
gl.useProgram(null);
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
gl.clearColor(0.0, 0.0, 0.0, 0.0);
}

@@ -161,0 +151,0 @@ }

{
"name": "@thumbmarkjs/thumbmarkjs",
"version": "0.12.3",
"version": "0.12.4",
"description": "",

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

Sorry, the diff of this file is not supported yet

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