use image::{ImageBuffer, ColorType, Rgb, RgbImage, write_buffer_with_format};
use image::ImageOutputFormat::Png;
use image::imageops::{FilterType, resize};
+use image::error::{LimitError, LimitErrorKind};
#[derive(Debug)]
}
fn error_response(&self) -> HttpResponse<BoxBody> {
- HttpResponse::InternalServerError().finish()
+ HttpResponse::InternalServerError().body(format!("{}\n", &self))
}
}
let mut pixels = img.pixels_mut();
for sp in ToRgbIter::new(data) {
- let mut dp = pixels.next().unwrap();
+ let mut dp = pixels.next().ok_or(ImageError(image::ImageError::Limits(LimitError::from_kind(LimitErrorKind::DimensionError))))?;
println!("{:?}", sp);
dp.0 = sp.0;
}