
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.