fix: specify width and height when importing raster images

This commit is contained in:
Ashley Wulber 2024-10-30 06:00:30 -04:00 committed by GitHub
parent d84447aaad
commit 842cd2ec94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,8 +74,8 @@ pub fn from_raster_pixels(
Handle {
symbolic: false,
data: match pixels.into() {
Cow::Owned(pixels) => Data::Image(image::Handle::from_bytes(pixels)),
Cow::Borrowed(pixels) => Data::Image(image::Handle::from_bytes(pixels)),
Cow::Owned(pixels) => Data::Image(image::Handle::from_rgba(width, height, pixels)),
Cow::Borrowed(pixels) => Data::Image(image::Handle::from_rgba(width, height, pixels)),
},
}
}