Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear return values for GenericImageView::bounds #1829

Closed
bjorn-ove opened this issue Dec 1, 2022 · 0 comments
Closed

Unclear return values for GenericImageView::bounds #1829

bjorn-ove opened this issue Dec 1, 2022 · 0 comments

Comments

@bjorn-ove
Copy link

bjorn-ove commented Dec 1, 2022

This happens in at least 0.24.5

Expected

Either (x, y, width, height) or (x, width, y, height) should be returned by the GenericImageView::bounds method

Actual behaviour

  • image/src/flat.rs

    Lines 1375 to 1378 in f64b52b

    fn bounds(&self) -> (u32, u32, u32, u32) {
    let (w, h) = self.dimensions();
    (0, w, 0, h)
    }
  • image/src/flat.rs

    Lines 1418 to 1421 in f64b52b

    fn bounds(&self) -> (u32, u32, u32, u32) {
    let (w, h) = self.dimensions();
    (0, w, 0, h)
    }
  • image/src/buffer.rs

    Lines 1150 to 1152 in f64b52b

    fn bounds(&self) -> (u32, u32, u32, u32) {
    (0, 0, self.width, self.height)
    }

Reproduction steps

Look at the source code

I'm happy to fix this in a PR, but are not sure if I'm missing something obvious as the code is pretty old.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants