test: fix new colorSpace spec

This commit is contained in:
Charles Kerr
2026-03-23 12:07:32 -05:00
parent 968b531890
commit 983322a397

View File

@@ -448,8 +448,8 @@ describe('nativeImage module', () => {
it('toBitmap() accepts a colorSpace option', () => {
const image = nativeImage.createFromPath(imageColorSpaceP3.path);
const srgbBuf = image.toBitmap({ colorSpace: { primaries: 'bt709', transferFunction: 'iec61966-2-1', matrix: 'rgb', range: 'full' } });
const p3Buf = image.toBitmap({ colorSpace: { primaries: 'smptest432-1', transferFunction: 'iec61966-2-1', matrix: 'rgb', range: 'full' } });
const srgbBuf = image.toBitmap({ colorSpace: { primaries: 'bt709', transfer: 'srgb', matrix: 'rgb', range: 'full' } });
const p3Buf = image.toBitmap({ colorSpace: { primaries: 'p3', transfer: 'srgb', matrix: 'rgb', range: 'full' } });
// Both should produce valid buffers of the same size (same pixel dimensions)
expect(srgbBuf.length).to.be.greaterThan(0);