Skip to content

Commit

Permalink
test: add test decoding blender Note (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny authored Dec 26, 2024
1 parent ff545ce commit 7ecb884
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Binary file added img/note.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/__tests__/decode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ describe('decode', () => {
expect(img.iccEmbeddedProfile.profile).toHaveLength(672);
});

it('tEXt chunk - ASCII', () => {
const { text } = loadAndDecode('note.png');
expect(text).toStrictEqual({
Note: 'Distance to target [Km]: 10',
});
});

it('tEXt chunk - ASCII', () => {
const { text } = loadAndDecode('text-ascii.png');
expect(text).toStrictEqual({
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { writeCrc } from './crc';

// https://www.w3.org/TR/png/#11tEXt

export const textChunkName = 'tEXt' as const;
export const textChunkName = 'tEXt';

const NULL = 0;

Expand Down

0 comments on commit 7ecb884

Please sign in to comment.