Skip to content

Commit

Permalink
test: Added test to check the decoding of TIFF image with the deflate…
Browse files Browse the repository at this point in the history
… compression mode
  • Loading branch information
yegor-pelykh committed Apr 12, 2024
1 parent 0f09f41 commit de0f48a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Binary file added test/_input/tiff/deflate.tif
Binary file not shown.
25 changes: 25 additions & 0 deletions test/format/format.tiff.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,31 @@ type TiffFileInfo = {
};

describe('Format: TIFF', () => {
test('deflate', () => {
const input = TestUtils.readFromFile(
TestFolder.input,
TestSection.tiff,
'deflate.tif'
);
const tiff = decodeTiff({
data: input,
});
expect(tiff).toBeDefined();
if (tiff === undefined) {
return;
}

const output = encodePng({
image: tiff,
});
TestUtils.writeToFile(
TestFolder.output,
TestSection.tiff,
'deflate.png',
output
);
});

test('16bit colormap', () => {
const input = TestUtils.readFromFile(
TestFolder.input,
Expand Down

0 comments on commit de0f48a

Please sign in to comment.