mirror of
https://github.com/TeamPiped/piped-proxy.git
synced 2024-08-14 23:50:45 +00:00
Fix panicking issue.
This commit is contained in:
parent
3a3c1ffee8
commit
85a4beeb54
1 changed files with 9 additions and 3 deletions
12
src/main.rs
12
src/main.rs
|
@ -215,10 +215,16 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Box<dyn Error>> {
|
|||
|
||||
let image = image::load_from_memory(&resp_bytes).unwrap();
|
||||
|
||||
let width = image.width() as usize;
|
||||
let height = image.height() as usize;
|
||||
|
||||
let buf = image.into_rgb8();
|
||||
let buf = buf.as_raw().as_rgb();
|
||||
|
||||
let buffer = Img::new(
|
||||
image.as_rgb8().unwrap().as_raw().as_rgb(),
|
||||
image.width() as usize,
|
||||
image.height() as usize,
|
||||
buf,
|
||||
width,
|
||||
height,
|
||||
);
|
||||
|
||||
let res = Encoder::new()
|
||||
|
|
Loading…
Reference in a new issue