From 8ae93cf38e0cb73c11035ee888d4bf69fe4efac3 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 12 Dec 2025 17:43:54 +0100 Subject: Fix asset size param missing --- server/src/ui/assets.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'server/src/ui') 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 */ 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/?")] @@ -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))) -- cgit v1.3