Use non-filling resize on server side. Client does filling.
This commit is contained in:
@@ -73,6 +73,7 @@ fn album(lib: Library, id: String) -> Result<impl warp::Reply, warp::Rejection>
|
||||
struct ImageParams {
|
||||
w: Option<u32>,
|
||||
h: Option<u32>,
|
||||
fill: Option<bool>,
|
||||
}
|
||||
|
||||
fn image(
|
||||
@@ -81,7 +82,11 @@ fn image(
|
||||
params: ImageParams,
|
||||
) -> Result<impl warp::Reply, warp::Rejection> {
|
||||
// TODO(wathiede): add caching headers.
|
||||
match lib.thumbnail(&media_items_id, (params.w, params.h)) {
|
||||
match lib.thumbnail(
|
||||
&media_items_id,
|
||||
(params.w, params.h),
|
||||
params.fill.unwrap_or(false),
|
||||
) {
|
||||
None => {
|
||||
warn!("Couldn't find original {}", &media_items_id);
|
||||
Err(warp::reject::not_found())
|
||||
|
||||
Reference in New Issue
Block a user