sehugg / dithertron

Retro 8-bit bitmap converter supporting many formats
GNU General Public License v3.0
75 stars 11 forks source link

UI / worker image mismatch with settings #15

Open robin-raymond opened 1 year ago

robin-raymond commented 1 year ago

When I'd switch from multi to hires I'd see these asserts and 'array length mismatch' happen, so I dug into the code. The issue is that the canvas and the UI get out of sync and when the target system changes the image in the dithertron is the old image while the settings is set to the new setting. This causes the logic that grabs the image width/height to miscalculate because it's not expecting to see a 1:1 matching for the image.

Can the code be fixed that the dithertron is reset, and the image is guaranteed to always be reinitialized prior to redoing the settings? I've not wanted to touch the UI stuff for fear I could really mess that area up.

robin-raymond commented 1 year ago

The switch can also cause assertion failures, which look concerning but only happen because the wrong image is being fed into the canvas during the switching process. They aren't harmful per say though because the correct image is fed in eventually but the asserts look bad in the output.