Skip to content

Commit

Permalink
feat: allow to pass iobuffer options to the decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Sep 20, 2016
1 parent b2766a5 commit 97f0f8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/decode.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
const TIFFDecoder = require('./tiffDecoder');

module.exports = function decodeTIFF(data, options) {
const decoder = new TIFFDecoder(data);
const decoder = new TIFFDecoder(data, options);
return decoder.decode(options);
};
9 changes: 6 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
const fs = require('fs');
const decode = require('.').decode;

var img = fs.readFileSync(__dirname + '/test/img/grey8.tif');

var img = fs.readFileSync(__dirname + '/Filipin G cyto - n000000.tif');
var result = decode(img);
var first = result[0];

console.log(first.map);
console.log(first.exif.map);

/*
console.log(first.fields.get(0x8769) ? true : false);
console.log(first.sampleFormat);
Expand All @@ -19,7 +22,7 @@ console.log((first.bitsPerSample));
console.log(first.sMinSampleValue);
console.log(first.sMaxSampleValue);

*/
//for (var ifd of result.ifd) {
// console.log(ifd)
//console.log(ifd.sampleFormat);
Expand Down

0 comments on commit 97f0f8e

Please sign in to comment.