diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-12-12 17:43:54 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-12-12 17:43:54 +0100 |
| commit | 8ae93cf38e0cb73c11035ee888d4bf69fe4efac3 (patch) | |
| tree | 74c7794c70f646f1075ea83fb55a05af10951e7d /server/src/ui | |
| parent | ed3cbc9380f6a5b2b83bfbd0d191268265607c5a (diff) | |
| download | jellything-8ae93cf38e0cb73c11035ee888d4bf69fe4efac3.tar jellything-8ae93cf38e0cb73c11035ee888d4bf69fe4efac3.tar.bz2 jellything-8ae93cf38e0cb73c11035ee888d4bf69fe4efac3.tar.zst | |
Fix asset size param missing
Diffstat (limited to 'server/src/ui')
| -rw-r--r-- | server/src/ui/assets.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/src/ui/assets.rs b/server/src/ui/assets.rs index 6bc92ef..494638c 100644 --- a/server/src/ui/assets.rs +++ b/server/src/ui/assets.rs @@ -4,14 +4,14 @@ Copyright (C) 2025 metamuffin <metamuffin.org> */ use super::error::MyResult; -use crate::helper::{cache::CacheControlImage, A}; -use anyhow::{anyhow, Context}; -use jellycommon::{api::NodeFilterSort, Asset, NodeID, PictureSlot}; +use crate::helper::{A, cache::CacheControlImage}; +use anyhow::{Context, anyhow}; +use jellycommon::{Asset, NodeID, PictureSlot, api::NodeFilterSort}; use jellylogic::{assets::get_node_thumbnail, node::get_node, session::Session}; use rocket::{get, http::ContentType, response::Redirect}; use std::str::FromStr; -pub const AVIF_QUALITY: u32 = 50; +pub const AVIF_QUALITY: u32 = 70; pub const AVIF_SPEED: u8 = 5; #[get("/image/<key..>?<size>")] @@ -22,13 +22,13 @@ pub async fn r_image( ) -> MyResult<(ContentType, CacheControlImage)> { let size = size.unwrap_or(2048); - if !key.0 .0.ends_with(".image") { + if !key.0.0.ends_with(".image") { Err(anyhow!("request to non-image"))? } // fit the resolution into a finite set so the maximum cache is finite too. let width = 2usize.pow(size.clamp(128, 2048).ilog2()); - let encoded = jellytranscoder::image::transcode(&key.0 .0, AVIF_QUALITY, AVIF_SPEED, width) + let encoded = jellytranscoder::image::transcode(&key.0.0, AVIF_QUALITY, AVIF_SPEED, width) .context("transcoding asset")?; Ok((ContentType::AVIF, CacheControlImage(encoded))) |