Comparing version 4.2.0 to 4.3.0
@@ -0,1 +1,8 @@ | ||
## [4.3.0](https://github.com/image-js/tiff/compare/v4.2.0...v4.3.0) (2020-12-03) | ||
### Features | ||
* add support for Zlib/deflate compression ([7d3a04c](https://github.com/image-js/tiff/commit/7d3a04c04c44d75373ccd6c7928cb69b3b725077)) | ||
# [4.2.0](https://github.com/image-js/tiff/compare/v4.1.3...v4.2.0) (2020-08-21) | ||
@@ -2,0 +9,0 @@ |
@@ -7,2 +7,3 @@ import { IOBuffer } from 'iobuffer'; | ||
import TiffIfd from './tiffIfd'; | ||
import { decompressZlib } from './zlib'; | ||
const defaultOptions = { | ||
@@ -191,2 +192,7 @@ ignoreImageData: false, | ||
} | ||
case 8: { | ||
// Zlib compression | ||
dataToFill = decompressZlib(stripData); | ||
break; | ||
} | ||
case 2: // CCITT Group 3 1-Dimensional Modified Huffman run length encoding | ||
@@ -197,3 +203,3 @@ throw unsupported('Compression', 'CCITT Group 3'); | ||
default: | ||
throw new Error(`invalid compression: ${ifd.compression}`); | ||
throw unsupported('Compression', ifd.compression); | ||
} | ||
@@ -200,0 +206,0 @@ pixel = this.fillUncompressed(bitDepth, sampleFormat, data, dataToFill, pixel, length); |
@@ -12,2 +12,3 @@ "use strict"; | ||
const tiffIfd_1 = __importDefault(require("./tiffIfd")); | ||
const zlib_1 = require("./zlib"); | ||
const defaultOptions = { | ||
@@ -196,2 +197,7 @@ ignoreImageData: false, | ||
} | ||
case 8: { | ||
// Zlib compression | ||
dataToFill = zlib_1.decompressZlib(stripData); | ||
break; | ||
} | ||
case 2: // CCITT Group 3 1-Dimensional Modified Huffman run length encoding | ||
@@ -202,3 +208,3 @@ throw unsupported('Compression', 'CCITT Group 3'); | ||
default: | ||
throw new Error(`invalid compression: ${ifd.compression}`); | ||
throw unsupported('Compression', ifd.compression); | ||
} | ||
@@ -205,0 +211,0 @@ pixel = this.fillUncompressed(bitDepth, sampleFormat, data, dataToFill, pixel, length); |
{ | ||
"name": "tiff", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"description": "TIFF image decoder written entirely in JavaScript", | ||
@@ -40,14 +40,16 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"iobuffer": "^5.0.2" | ||
"iobuffer": "^5.0.2", | ||
"pako": "^2.0.2" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^26.0.10", | ||
"@types/node": "^14.6.0", | ||
"eslint": "^7.7.0", | ||
"eslint-config-cheminfo-typescript": "^7.0.0", | ||
"jest": "^26.4.1", | ||
"prettier": "^2.0.5", | ||
"@types/jest": "^26.0.16", | ||
"@types/node": "^14.14.10", | ||
"@types/pako": "^1.0.1", | ||
"eslint": "^7.14.0", | ||
"eslint-config-cheminfo-typescript": "^8.0.5", | ||
"jest": "^26.6.3", | ||
"prettier": "^2.2.1", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^26.2.0", | ||
"typescript": "^4.0.2" | ||
"ts-jest": "^26.4.4", | ||
"typescript": "^4.1.2" | ||
}, | ||
@@ -54,0 +56,0 @@ "prettier": { |
@@ -17,8 +17,2 @@ # tiff | ||
### Platform | ||
This package is written using ES2015 features. It is natively compatible with | ||
recent web browsers and Node.js. You can transpile it with a tool like | ||
[babel](https://babeljs.io/) if you need to support more JavaScript engines. | ||
### [TIFF standard](./TIFF6.pdf) | ||
@@ -29,2 +23,6 @@ | ||
### Extensions | ||
Images compressed with Zlib/deflate algorithm are also supported. | ||
## API | ||
@@ -31,0 +29,0 @@ |
@@ -12,2 +12,3 @@ import { IOBuffer } from 'iobuffer'; | ||
import { BufferType, IDecodeOptions, IFDKind, DataArray } from './types'; | ||
import { decompressZlib } from './zlib'; | ||
@@ -232,2 +233,7 @@ const defaultOptions: IDecodeOptions = { | ||
} | ||
case 8: { | ||
// Zlib compression | ||
dataToFill = decompressZlib(stripData); | ||
break; | ||
} | ||
case 2: // CCITT Group 3 1-Dimensional Modified Huffman run length encoding | ||
@@ -238,3 +244,3 @@ throw unsupported('Compression', 'CCITT Group 3'); | ||
default: | ||
throw new Error(`invalid compression: ${ifd.compression}`); | ||
throw unsupported('Compression', ifd.compression); | ||
} | ||
@@ -241,0 +247,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
184601
76
3463
2
10
75
+ Addedpako@^2.0.2
+ Addedpako@2.1.0(transitive)