macroquad icon indicating copy to clipboard operation
macroquad copied to clipboard

Added a safer constructor for Image

Open eliPerez12 opened this issue 2 years ago • 1 comments

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.

eliPerez12 avatar Aug 25 '23 22:08 eliPerez12

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

asmodehn avatar Jan 29 '24 20:01 asmodehn