geotiffjs / geotiff.js

geotiff.js is a small library to parse TIFF files for visualization or analysis. It is written in pure JavaScript, and is usable in both the browser and node.js applications.
https://geotiffjs.github.io/
MIT License
866 stars 182 forks source link

geotiffimage: stop mentioning that readRGB() forces interleaving #426

Open sguimmara opened 6 months ago

sguimmara commented 6 months ago

This PR fixes documentation that mention that readRGB() always interleave pixels (it does not if interleave: false in the options).

There is even an existing test case that proves it:

  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);
  });

fixes #424