From 0e3dfc7bdaf4af4ac6a62b0cf1286cd45019c8ee Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sat, 17 Aug 2024 08:54:28 +0200 Subject: [PATCH] Added extra unit test for the metaChannelCount property. --- tests/magick-image/meta-channel-count.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/magick-image/meta-channel-count.spec.ts b/tests/magick-image/meta-channel-count.spec.ts index b9f03857..7692c44d 100644 --- a/tests/magick-image/meta-channel-count.spec.ts +++ b/tests/magick-image/meta-channel-count.spec.ts @@ -3,6 +3,7 @@ Licensed under the Apache License, Version 2.0. */ +import { MagickFormat } from '@src/enums/magick-format'; import { TestImages } from '@test/test-images'; describe('MagickImage#metaChannelCount', () => { @@ -23,4 +24,17 @@ describe('MagickImage#metaChannelCount', () => { expect(() => image.metaChannelCount = 54).toThrowError('MaximumChannelsExceeded'); }) }); + + it('should save extra channels in a TIFF file', () => { + TestImages.imageMagickJpg.use(input => { + input.metaChannelCount = 2; + + input.write(MagickFormat.Tiff, (data) => { + TestImages.empty.use((output) => { + output.read(data); + expect(output.metaChannelCount).toBe(2); + }); + }); + }); + }); });