aboutsummaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/routes/ui/assets.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/src/routes/ui/assets.rs b/server/src/routes/ui/assets.rs
index 8c0496e..f88faa4 100644
--- a/server/src/routes/ui/assets.rs
+++ b/server/src/routes/ui/assets.rs
@@ -7,7 +7,7 @@ use crate::{
database::Database,
routes::ui::{account::session::Session, error::MyError, CacheControlFile},
};
-use anyhow::anyhow;
+use anyhow::{anyhow, Context};
use jellybase::AssetLocationExt;
use jellycommon::AssetLocation;
use log::info;
@@ -53,10 +53,12 @@ pub async fn r_item_assets(
));
// fit the resolution into a finite set so the maximum cache is finite too.
let width = 2usize.pow(width.unwrap_or(2048).clamp(128, 8196).ilog2());
- let path = jellytranscoder::image::transcode(asset, 50., 5, width).await?;
+ let path = jellytranscoder::image::transcode(asset, 50., 5, width)
+ .await
+ .context("transcoding asset")?;
info!("loading asset from {path:?}");
Ok((
ContentType::AVIF,
- CacheControlFile::new(File::open(path.path()).await?).await,
+ CacheControlFile::new(File::open(path.path()).await.context("opening file")?).await,
))
}