Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/parsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Binary file added tests/input/digest_test.mark
Binary file not shown.
11 changes: 11 additions & 0 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down