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

The documentation on crop() is confusing #2293

Open
Shnatsel opened this issue Jul 28, 2024 · 1 comment
Open

The documentation on crop() is confusing #2293

Shnatsel opened this issue Jul 28, 2024 · 1 comment

Comments

@Shnatsel
Copy link
Contributor

See https://docs.rs/image/0.25.2/image/enum.DynamicImage.html#method.crop

In image v0.25.2 the documentation for crop() states:

Note: this method does not modify the object, and its signature will be replaced with crop_imm()’s in the 0.24 release

It also took me a while to get what "does not modify the object" actually refers to. At first I thought that maybe it returns a view into the image or something. But no, it actually returns a different buffer altogether.

It's weird that it talks about 0.24 as if it's in the future in docs for v0.25. And the signatures are still different. I guess that's a work item for 0.26 now.

@Shnatsel
Copy link
Contributor Author

Adding to the confusion, imageops::crop_imm() returns a view into an existing image, while DynamicImage::crop() returns a new image buffer.

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

1 participant