fix: Iterate textChunks to find character data

This commit is contained in:
Vornir Jotunn 2024-01-25 20:32:21 +01:00
parent e3ccaf70a1
commit 84a21fba27
1 changed files with 3 additions and 1 deletions

View File

@ -22,7 +22,9 @@ const parse = async (cardUrl, format) => {
throw new Error('No PNG metadata.');
}
return Buffer.from(textChunks[0].text, 'base64').toString('utf8');
let index = textChunks.findIndex((chunk) => chunk.keyword.toLowerCase() == 'chara');
return Buffer.from(textChunks[index].text, 'base64').toString('utf8');
}
default:
break;