Extra info on Image debug assertions (#13628)
Small message change that helps fix invalid slice lengths given to `Image::new_fill`.
This commit is contained in:
parent
8d666c8adf
commit
159b9a9091
@ -552,11 +552,13 @@ impl Image {
|
||||
debug_assert_eq!(
|
||||
pixel.len() % format.pixel_size(),
|
||||
0,
|
||||
"Must not have incomplete pixel data."
|
||||
"Must not have incomplete pixel data (pixel size is {}B).",
|
||||
format.pixel_size(),
|
||||
);
|
||||
debug_assert!(
|
||||
pixel.len() <= value.data.len(),
|
||||
"Fill data must fit within pixel buffer."
|
||||
"Fill data must fit within pixel buffer (expected {}B).",
|
||||
value.data.len(),
|
||||
);
|
||||
|
||||
for current_pixel in value.data.chunks_exact_mut(pixel.len()) {
|
||||
|
Loading…
Reference in New Issue
Block a user