Skip to content

Conversation

@hauserkristof
Copy link
Contributor

@hauserkristof hauserkristof commented May 19, 2025

This PR adds error handling to multiple places.

This is depending on #19

This is a smaller part of #13 for easier review.

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);
Copy link
Collaborator

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?

Copy link
Contributor Author

@hauserkristof hauserkristof Jul 15, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants