Socket
Socket
Sign inDemoInstall

tiff.js

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiff.js

tiff.js is a port of the LibTIFF by compiling the LibTIFF C code with Emscripten.


Version published
Maintainers
1
Weekly downloads
3,363
decreased by-23.53%
Bundle size
385.6 kB
Minified + gzipped

Weekly downloads

Readme

Source

tiff.js

tiff.js is a port of the LibTIFF by compiling the LibTIFF C code with Emscripten.

Demo

Usage

Use tiff.min.js:

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();

API

see tiff.d.ts

Note

  • This library does not support JPEG-based compressed TIFF files
    • I failed to link a JPEG library ... ;-p
  • When you load large tiff file, you will see the error message "Cannot enlarge memory arrays in asm.js"
    • in such case, please call 'Tiff.initialize({TOTAL_MEMORY: ... })' before you create a Tiff instance
  • This JavaScript library uses only some parts of the LibTIFF features
    • To be more precise, I use following functions only
    • TIFFOpen, TIFFClose, TIFFGetField, TIFFReadRGBAImage, TIFFSetDirectory, TIFFCurrentDirectory, TIFFReadDirectory

License

The LibTIFF is LibTIFF Software License, zlib and additional code are zlib License.

Keywords

FAQs

Last updated on 15 Aug 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc