Is your issue REALLY a bug?
Is there an existing issue for this?
Is this issue related to iced?
What happened?
use iced::{Element, widget::image};
fn main() -> iced::Result {
iced::application(App, App::update, App::view).run()
}
struct App();
impl App {
fn view(&self) -> Element<'_, Message> {
let placeholder = image::Handle::from_rgba(0, 0, vec![]); // crashes
// let placeholder = image::Handle::from_rgba(1, 1, vec![0; 4]); // does not crash
image(placeholder).into()
}
fn update(&mut self, _: Message) {}
}
enum Message {}
The given program panics with the logs given below whenever it tries to render the image. It should either disallow accepting 0s as arguments (via NonZero), render an empty image or panic with a more debuggable message.
What is the expected behavior?
Empty image or a panic with a better message.
Version
master
Operating System
Linux
Do you have any log output?
https://gist.github.com/Brogolem35/8d8569c0bfea2935e3ef6678952fb652
Is your issue REALLY a bug?
Is there an existing issue for this?
Is this issue related to iced?
What happened?
The given program panics with the logs given below whenever it tries to render the image. It should either disallow accepting 0s as arguments (via NonZero), render an empty image or panic with a more debuggable message.
What is the expected behavior?
Empty image or a panic with a better message.
Version
master
Operating System
Linux
Do you have any log output?