-
Notifications
You must be signed in to change notification settings - Fork 24
feat: add proper error handling #20
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
base: main
Are you sure you want to change the base?
Conversation
like empty silkscreen
| gingerbread.conversion_add_raster_layer(layer.number, this.trace_scale_factor, imgdata); | ||
|
|
||
| // Check that the ImageData is valid | ||
| const imgdata_sum = imgdata.data.reduce((a, b) => a + b, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be 0 for an all black image, which would still be a valid, if silly, image. Would it be better to check if the length is 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe, I will test it tomorrow!
I had problems with all black images previously, so I had to add this, but maybe checking for length is enough
This PR adds error handling to multiple places.
This is depending on #19
This is a smaller part of #13 for easier review.