{"versions":{"0.1.0":{"name":"decode-tiff","version":"0.1.0","description":"Lightweight tiff decoder","main":"index.js","scripts":{"test":"ava","build":"webpack --config example/browser/webpack.config.js","deploy":"npm run build && gh-pages -d example/browser"},"repository":{"type":"git","url":"git+ssh://git@github.com/Quramy/decode-tiff.git"},"keywords":["image","codec","tiff"],"author":{"name":"Quramy"},"license":"MIT","devDependencies":{"ava":"^0.21.0","gh-pages":"^1.0.0","glob":"^7.1.2","pngjs":"^3.2.0","rimraf":"^2.6.1","webpack":"^3.0.0"},"ava":{"files":"test/**/*.test.js"},"gitHead":"513d0659bc069cad6df18e0796b91d362665436a","bugs":{"url":"https://github.com/Quramy/decode-tiff/issues"},"homepage":"https://github.com/Quramy/decode-tiff#readme","_id":"decode-tiff@0.1.0","_npmVersion":"5.0.0","_nodeVersion":"6.10.2","_npmUser":{"name":"anonymous","email":"yosuke.kurami@gmail.com"},"dist":{"integrity":"sha512-PXLl2//0Yy5mS+gci/jc1FMECMyaDqdZyijl9NNLtPm5Bbs8FMHuddyn1NifC9KPtbGEt2l+1F7gjl98CFhGjQ==","shasum":"cbe0f78ec631d3726abaef22291196163c1fbdbf","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/decode-tiff/-/decode-tiff-0.1.0.tgz","size":1295368},"maintainers":[{"name":"anonymous","email":"yosuke.kurami@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/decode-tiff-0.1.0.tgz_1500292090675_0.9958461232017726"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T02:09:06.227Z","contributors":[]},"0.2.0":{"name":"decode-tiff","version":"0.2.0","description":"Lightweight tiff decoder","main":"lib/index.js","scripts":{"test":"ava","build:node":"mkdirp lib; babel src/index.js > lib/index.js","build:browser":"mkdirp dist; browserify -t [ babelify ] src/browser.js | uglifyjs --compress --mangle > dist/decode-tiff.min.js","build:example":"cp dist/decode-tiff.min.js example/browser","deploy":"npm run build:example && gh-pages -d example/browser","prepublish":"npm run build:node && npm run build:browser"},"repository":{"type":"git","url":"git+ssh://git@github.com/Quramy/decode-tiff.git"},"keywords":["image","codec","tiff"],"author":{"name":"Quramy"},"license":"MIT","devDependencies":{"ava":"^0.21.0","babel-cli":"^6.24.1","babel-preset-es2015":"^6.24.1","babelify":"^7.3.0","browserify":"^14.4.0","gh-pages":"^1.0.0","glob":"^7.1.2","mkdirp":"^0.5.1","pngjs":"^3.2.0","rimraf":"^2.6.1","uglify-js":"^3.0.25"},"ava":{"files":"test/**/*.test.js"},"gitHead":"333872feaa5178f64fec28ea99b2cee0016cb171","bugs":{"url":"https://github.com/Quramy/decode-tiff/issues"},"homepage":"https://github.com/Quramy/decode-tiff#readme","_id":"decode-tiff@0.2.0","_npmVersion":"5.0.0","_nodeVersion":"6.10.2","_npmUser":{"name":"anonymous","email":"yosuke.kurami@gmail.com"},"dist":{"integrity":"sha512-qrZ4NXrU8CMoADpt8ckJpr9emQDJmK4O0+nQzwrDFdWmHC7pD2w+rJZD8egGyUyD6Vlb5RUgKN1VgpfN8k6shQ==","shasum":"540b2949efedee689e3e20224cc04af6b82ad88a","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/decode-tiff/-/decode-tiff-0.2.0.tgz","size":1296758},"maintainers":[{"name":"anonymous","email":"yosuke.kurami@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/decode-tiff-0.2.0.tgz_1500337861981_0.24493211624212563"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T02:09:08.323Z","contributors":[]},"0.2.1":{"name":"decode-tiff","version":"0.2.1","description":"Lightweight tiff decoder","main":"lib/index.js","scripts":{"test":"ava","build:node":"mkdirp lib; babel src/index.js > lib/index.js","build:browser":"mkdirp dist; browserify -t [ babelify ] src/browser.js | uglifyjs --compress --mangle > dist/decode-tiff.min.js","build:example":"cp dist/decode-tiff.min.js example/browser","deploy":"npm run build:example && gh-pages -d example/browser","prepublish":"npm run build:node && npm run build:browser"},"repository":{"type":"git","url":"git+ssh://git@github.com/Quramy/decode-tiff.git"},"keywords":["image","codec","tiff"],"author":{"name":"Quramy"},"license":"MIT","devDependencies":{"ava":"^0.21.0","babel-cli":"^6.24.1","babel-preset-es2015":"^6.24.1","babelify":"^7.3.0","browserify":"^14.4.0","gh-pages":"^1.0.0","glob":"^7.1.2","mkdirp":"^0.5.1","pngjs":"^3.2.0","rimraf":"^2.6.1","uglify-js":"^3.0.25"},"ava":{"files":"test/**/*.test.js"},"gitHead":"abef05962a26f8b77887da5b2e154fb7a53fd57c","bugs":{"url":"https://github.com/Quramy/decode-tiff/issues"},"homepage":"https://github.com/Quramy/decode-tiff#readme","_id":"decode-tiff@0.2.1","_npmVersion":"5.0.0","_nodeVersion":"6.10.2","_npmUser":{"name":"anonymous","email":"yosuke.kurami@gmail.com"},"dist":{"integrity":"sha512-v/7hQBv/DrOVQ+Eljg0BLMRbXZYuuw3YZ8duZuFxYpo6qUkdn7oFRkN95RZKbnh08EHNjrMXMbEUNhTLuhPvvA==","shasum":"c18ca071b8decf5d49b0c732ead4f6bb061142cb","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/decode-tiff/-/decode-tiff-0.2.1.tgz","size":1296832},"maintainers":[{"name":"anonymous","email":"yosuke.kurami@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/decode-tiff-0.2.1.tgz_1500359154065_0.05548459687270224"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T02:09:08.513Z","contributors":[]}},"dist-tags":{"latest":"0.2.1"},"name":"decode-tiff","time":{"created":"2022-01-26T17:26:52.652Z","modified":"2022-01-26T17:26:52.652Z","0.1.0":"2017-07-17T11:48:10.990Z","0.2.0":"2017-07-18T00:31:02.321Z","0.2.1":"2017-07-18T06:25:54.365Z"},"readme":"# decode-tiff\n[![npm version](https://badge.fury.io/js/decode-tiff.svg)](https://badge.fury.io/js/decode-tiff)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n:zap: A lightweight pure JavaScript TIFF decoder. :art:\n\n## How to use it\n### With Node.js\n\n```sh\nnpm i tiff-decode\n```\n\nThe following example reads .tiff and converts to .png file using [pngjs](https://www.npmjs.com/package/pngjs).\n\n```js\nconst { decode } = require(\"decode-tiff\");\n\nconst { PNG } = require(\"pngjs\");\nconst fs = require(\"fs\");\n\nconst { width, height, data } = decode(fs.readFileSync(__dirname + \"/lena_color.tiff\"));\n\nconst png =  new PNG({ width, height });\npng.data = data;\nfs.writeFileSync(__dirname + \"/lena.png\", PNG.sync.write(png));\n```\n\n### With Browser\n\nDownload script file from [dist/decode-tiff.min.js](https://raw.githubusercontent.com/Quramy/decode-tiff/master/dist/decode-tiff.min.js). Alternatively you can use Module Bundler, such as webpack, Browserify, and Rollup.\n\nThis example shows metadata of the dropped file. [Working demonstration is here.](https://quramy.github.io/decode-tiff/)\n\n```html\n<html>\n<head></head>\n<body>\n\n  <div id=\"drop\">\n    <p>Drop TIFF file here!</p>\n  </div>\n\n<script src=\"decode-tiff.min.js\"></script>\n<script>\nconst { decode } = window.decodeTiff;\nconst elm = document.getElementById(\"drop\");\nelm.addEventListener(\"dragenter\", e => e.preventDefault());\nelm.addEventListener(\"dragover\", e => e.preventDefault());\nelm.addEventListener(\"drop\", e => {\n  e.preventDefault();\n  const file = e.dataTransfer.files[0];\n  const reader = new FileReader();\n  reader.addEventListener(\"load\", e => {\n    const arrayBuffer = e.target.result;\n    const { width, height, ifdEntries } = decode(arrayBuffer);\n    const metadata = JSON.stringify({ width, height, ifdEntries }, null, 2);\n    elm.innerHTML = `<pre>${metadata}</pre>`;\n  });\n  reader.readAsArrayBuffer(file);\n});\n</script>\n</body>\n</html>\n```\n\n## API\n### `decode(buffer: ArrayBuffer | Buffer, options?: { singlePage?: boolean }): TiffImage | TiffImage[]`\n\n- params\n  - `buffer` - *Required* - Buffer of the target TIFF image. Node.js Buffer and ECMA Script's ArrayBuffer are acceptable.\n  - `options.singlePage` - *Optional (default: `true`)* - If true, this function returns a single TiffImage object. If the input has 2 or more pages, return value will be the first page.\n- returns\n  - `TiffImage` - An object.\n  - `TiffImage.width` - *number* - Width of the input image.\n  - `TiffImage.height` - *number* - Height of the input image.\n  - `TiffImage.data` - *Uint8Array* - Image pixel data. Every pixel consists 4 bytes: R, G, B, A (opacity)\n  - `TiffImage.ifdEntries` - *{[key: string]: Array}* - Each IFD entries of the input image.\n\n## Compatibility\n\n- Byte Order\n  - [x] Little endian\n  - [x] Big endian\n- Color resolusion\n  - [x] 32bit Full Colors\n  - [x] 24bit Full Colors\n  - [x] 8bit Gray scale\n  - [x] 4bit Gray scale\n  - [ ] Palette-Color\n  - [ ] Bilevel(white)\n  - [ ] Bilevel(black)\n- Compression\n  - [x] No Compression\n  - [ ] CCITT Group 3\n  - [ ] LZW Compression\n  - [ ] ZIP\n  - [ ] Packbits\n- Masking\n  - [ ] Transparency Mask\n\n## License\nMIT. See LICENSE.txt.","users":{}}