Crash on tiny_skia
backend when rendering zero-width/height image
#2877
Labels
bug
Something isn't working
Is your issue REALLY a bug?
Is there an existing issue for this?
Is this issue related to iced?
What happened?
Rendering an image widget with zero pixels results in a panic in Iced's tiny_skia code.
Minimal example:
This results in an immediate panic of
Build pixmap from image bytes
.iced/tiny_skia/src/raster.rs
Line 115 in e462535
Note that this doesn't appear(?) to panic when running with the
wgpu
backend.What is the expected behavior?
Well, anything except panic.
Assuming this isn't expected behaviour (I don't think it is), ideally an empty element should be returned with no work done, i.e., the equivalent of
row![].into()
. Alternatively,image
could return aResult
.If this is expected behaviour, it could be documented on the Image widget, and the error message could be more helpful. And, this behaviour should be standardized on the other backends.
Version
crates.io release
Operating System
Linux
Do you have any log output?
The text was updated successfully, but these errors were encountered: