feat: image resizing (#5446)

Add image resizing on the client side to reduce load on the API
This commit is contained in:
jif-oai
2025-10-27 16:58:10 +00:00
committed by GitHub
parent 775fbba6e0
commit aea7610c76
11 changed files with 684 additions and 28 deletions

View File

@@ -0,0 +1,25 @@
use image::ImageFormat;
use std::path::PathBuf;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum ImageProcessingError {
#[error("failed to read image at {path}: {source}")]
Read {
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("failed to decode image at {path}: {source}")]
Decode {
path: PathBuf,
#[source]
source: image::ImageError,
},
#[error("failed to encode image as {format:?}: {source}")]
Encode {
format: ImageFormat,
#[source]
source: image::ImageError,
},
}