From 5acac410d4f565de98775d4e2762ecb8045bade9 Mon Sep 17 00:00:00 2001 From: Fleeym <61891787+Fleeym@users.noreply.github.com> Date: Sat, 15 Jun 2024 14:57:24 +0300 Subject: [PATCH] some other fixes --- src/endpoints/mods.rs | 5 +---- src/types/mod_json.rs | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/endpoints/mods.rs b/src/endpoints/mods.rs index 7e3c660..16c4b8f 100644 --- a/src/endpoints/mods.rs +++ b/src/endpoints/mods.rs @@ -203,10 +203,7 @@ pub async fn get_logo( match image { Some(i) => { if i.is_empty() { - Ok(HttpResponse::NotFound().json(web::Json(ApiResponse { - error: "Not found".to_string(), - payload: "".to_string(), - }))) + Ok(HttpResponse::NotFound().body("")) } else { Ok(HttpResponse::Ok().content_type("image/png").body(i)) } diff --git a/src/types/mod_json.rs b/src/types/mod_json.rs index df3750a..e0c898c 100644 --- a/src/types/mod_json.rs +++ b/src/types/mod_json.rs @@ -386,7 +386,7 @@ pub fn validate_mod_logo(file: &mut ZipFile, return_bytes: bool) -> Result i, Err(e) => { log::error!("{}", e); @@ -404,7 +404,7 @@ pub fn validate_mod_logo(file: &mut ZipFile, return_bytes: bool) -> Result 336) || (dimensions.1 > 336) { - img.resize(336, 336, image::imageops::FilterType::Lanczos3); + img = img.resize(336, 336, image::imageops::FilterType::Lanczos3); } if !return_bytes {