GithubHelp home page GithubHelp logo

asavpatel92 / tiff.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seikichi/tiff.js

0.0 1.0 0.0 36.26 MB

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

License: Other

Shell 27.40% C 1.72% JavaScript 7.79% TypeScript 63.09%

tiff.js's Introduction

tiff.js

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

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.

tiff.js's People

Contributors

seikichi avatar

Watchers

Asav Patel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.