diff options
Diffstat (limited to 'server/src/routes/ui/assets.rs')
-rw-r--r-- | server/src/routes/ui/assets.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/routes/ui/assets.rs b/server/src/routes/ui/assets.rs index 115c02a..c278a31 100644 --- a/server/src/routes/ui/assets.rs +++ b/server/src/routes/ui/assets.rs @@ -20,6 +20,9 @@ use log::info; use rocket::{get, http::ContentType, response::Redirect, State}; use std::path::PathBuf; +pub const AVIF_QUALITY: f32 = 50.; +pub const AVIF_SPEED: u8 = 5; + #[get("/asset/<token>?<width>")] pub async fn r_asset( _session: Session, @@ -43,8 +46,7 @@ pub async fn r_asset( // fit the resolution into a finite set so the maximum cache is finite too. let width = 2usize.pow(width.clamp(128, 2048).ilog2()); - // TODO configure avif quality and speed. - jellytranscoder::image::transcode(source, 50., 5, width) + jellytranscoder::image::transcode(source, AVIF_QUALITY, AVIF_SPEED, width) .await .context("transcoding asset")? }; |