diff --git a/src/parsing.ts b/src/parsing.ts index 5dcc985..2c73d0d 100644 --- a/src/parsing.ts +++ b/src/parsing.ts @@ -408,7 +408,7 @@ export class SupernoteX implements ISupernote { /** Parse Supernote file signature from buffer. */ _parseSignature(buffer: Uint8Array): string { - const pattern = /^noteSN_FILE_VER_(\d{8})/; + const pattern = /^(?:mark|note)SN_FILE_VER_(\d{8})/; const content = uint8ArrayToString(buffer, 'utf8', 0, 24); const match = content.match(pattern); if (!match) diff --git a/tests/input/digest_test.mark b/tests/input/digest_test.mark new file mode 100644 index 0000000..262fe9f Binary files /dev/null and b/tests/input/digest_test.mark differ diff --git a/tests/main.test.ts b/tests/main.test.ts index b7b9a16..7141178 100644 --- a/tests/main.test.ts +++ b/tests/main.test.ts @@ -64,6 +64,17 @@ describe("links", () => { }) }) +describe("digest_image", () => { + test("convert a mark file into a png image", { timeout: 30000 }, async () => { + const sn = new SupernoteX(await readFileToUint8Array("digest_test.mark")) + const images = await toImage(sn) + expect(images).not.toBeUndefined() + for await (const [index, image] of images.entries()) { + await imagejs.writeSync(`tests/output/digest_test.mark-${index}.png`, image) + } + }) +}) + describe("nomad", () => { test("convert a note from a nomad Chauvet 3.15.27 to png pages", { timeout: 30000 }, async () => { const sn = new SupernoteX(await readFileToUint8Array("nomad-3.15.27-blank-2p.note"))