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

Added a safer constructor for Image #637

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eliPerez12
Copy link

@eliPerez12 eliPerez12 commented Aug 25, 2023

This PR is the solution to issue #634.

I've added a new constructor Image::new(width, height) -> Image , which abstracts away the process of making a new image, making it less error prone. Having to manually manage the amount of bytes needed was unnecessary and inefficient.

This is my first ever pull request so let me know if i missed anything or need to improve on anything.

@asmodehn
Copy link

Just jumping in here since I encountered issues with image manipulation for a small project:

We probably want to check overflows of usize type here. see for instance https://docs.rs/image/latest/src/image/buffer.rs.html#1271

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

Successfully merging this pull request may close these issues.

None yet

2 participants