Skip to content

Commit

Permalink
Adding tests for requesting non-interleaved RGB data
Browse files Browse the repository at this point in the history
  • Loading branch information
constantinius committed Sep 6, 2021
1 parent dc5e8a1 commit 3453f14
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/geotiff.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,16 @@ describe('RGB-tests', () => {
const tiff = await GeoTIFF.fromSource(createSource('rgb_paletted.tiff'));
await performRGBTest(tiff, options, comparisonRaster, 15);
});

it('should read into non-interleaved arrays if requested', async () => {
const tiff = await GeoTIFF.fromSource(createSource('rgb.tiff'));
const image = await tiff.getImage();
const data = await image.readRGB({ ...options, interleave: false });
expect(data).to.have.lengthOf(3);
expect(data[0]).to.have.lengthOf(50 * 50);
expect(data[1]).to.have.lengthOf(50 * 50);
expect(data[2]).to.have.lengthOf(50 * 50);
});
});

describe("Abort signal", () => {
Expand Down

0 comments on commit 3453f14

Please sign in to comment.