Skip to content

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

Merged
constantinius merged 2 commits into
geotiffjs:masterfrom
sguimmara:fix-readrgb-documentation
Jun 2, 2025
Merged

geotiffimage: stop mentioning that readRGB() forces interleaving#426
constantinius merged 2 commits into
geotiffjs:masterfrom
sguimmara:fix-readrgb-documentation

Conversation

@sguimmara
Copy link
Copy Markdown
Contributor

@sguimmara sguimmara commented Mar 26, 2024

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

@TheMrCam TheMrCam added the docs Improvements or additions to documentation label May 29, 2025
Copy link
Copy Markdown
Collaborator

@TheMrCam TheMrCam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM beyond my one pedantic suggestion for the README

Comment thread README.md Outdated
@constantinius
Copy link
Copy Markdown
Member

Looks good to me. I'll merge this with @TheMrCam 's suggestion

Co-authored-by: Cameron Woodbury <63317483+TheMrCam@users.noreply.github.com>
@constantinius constantinius merged commit 12af432 into geotiffjs:master Jun 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

readRGB() does not always return an interleaved array

3 participants