
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
browser-tiff.js
Advanced tools
browser-tiff.js is a conversion of tiff.js, that nullified the require('crypto'), require('fs') inside the script when importing to web projects
browser-tiff.js is a direct clone of tiff.js, but with require() methods removed, so it can work without errors during 'import' and compilation for web projects.
Below are the only changes to tiff.min.js, basically Function.prototype() act like noop()
From:
... = require(...)
To:
... = Function.prototype(...)
import * as Tiff from 'browser-tiff.js';
tiff.js is a port of the LibTIFF by compiling the LibTIFF C code with Emscripten.
Download tiff.min.js and load the script by yourself:
var xhr = new XMLHttpRequest();
xhr.responseType = 'arraybuffer';
xhr.open('GET', "url/of/a/tiff/image/file.tiff");
xhr.onload = function (e) {
var tiff = new Tiff({buffer: xhr.response});
var canvas = tiff.toCanvas();
document.body.append(canvas);
};
xhr.send();
$ npm install tiff.js
Example
// Usage: node this-file.js input.tiff
var Tiff = require('tiff.js');
var fs = require('fs');
var filename = process.argv[2];
var input = fs.readFileSync(filename);
var image = new Tiff({ buffer: input });
console.log(filename + ': width = ' + image.width() + ', height = ' + image.height());
see tiff.d.ts
The LibTIFF is LibTIFF Software License, zlib and additional code are zlib License.
FAQs
browser-tiff.js is a conversion of tiff.js, that nullified the require('crypto'), require('fs') inside the script when importing to web projects
We found that browser-tiff.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.