Provide XMP as a string, as well as a Buffer, where possible

This commit is contained in:
Lovell Fuller
2025-07-04 15:55:41 +01:00
parent 4e3f3792ad
commit 8ee8d273ee
5 changed files with 12 additions and 0 deletions

View File

@@ -82,6 +82,7 @@ describe('Image metadata', function () {
assert.strictEqual(true, metadata.xmp instanceof Buffer);
assert.strictEqual(12466, metadata.xmp.byteLength);
assert.strictEqual(metadata.xmp.indexOf(Buffer.from('<?xpacket begin="')), 0);
assert(metadata.xmpAsString.startsWith('<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>'));
done();
});
});
@@ -106,6 +107,8 @@ describe('Image metadata', function () {
assert.strictEqual(3248, metadata.autoOrient.height);
assert.strictEqual('undefined', typeof metadata.exif);
assert.strictEqual('undefined', typeof metadata.icc);
assert.strictEqual('undefined', typeof metadata.xmp);
assert.strictEqual('undefined', typeof metadata.xmpAsString);
assert.strictEqual('inch', metadata.resolutionUnit);
done();
});