From f04da5eb539a36cd901be4bf3bd43b0d017ef3e4 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 9 Jan 2025 16:41:44 +0100 Subject: [PATCH] 1024px banner --- config/defaults.hjson | 10 +++------- crates/utils/src/settings/structs.rs | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/config/defaults.hjson b/config/defaults.hjson index c13b70907..56565b213 100644 --- a/config/defaults.hjson +++ b/config/defaults.hjson @@ -66,13 +66,9 @@ max_thumbnail_size: 512 # Maximum size for user avatar, community icon and site icon. max_avatar_size: 512 - # Maximum size for user, community and site banner. - # - # TODO: Unfortunately pictrs can only resize images to fit in a*a square, no rectangle. - # Otherwise we have to use crop, or use max_width/max_height which throws error - # if image is larger. - # TODO: whats a sensible default here? - max_banner_size: 512 + # Maximum size for user, community and site banner. Larger images are downscaled to fit + # into a square of this size. + max_banner_size: 1024 # Prevent users from uploading images for posts or embedding in markdown. Avatars, icons and # banners can still be uploaded. image_upload_disabled: false diff --git a/crates/utils/src/settings/structs.rs b/crates/utils/src/settings/structs.rs index 153c4567e..1b0bc60f0 100644 --- a/crates/utils/src/settings/structs.rs +++ b/crates/utils/src/settings/structs.rs @@ -109,13 +109,9 @@ pub struct PictrsConfig { #[default(512)] pub max_avatar_size: u32, - /// Maximum size for user, community and site banner. - /// - /// TODO: Unfortunately pictrs can only resize images to fit in a*a square, no rectangle. - /// Otherwise we have to use crop, or use max_width/max_height which throws error - /// if image is larger. - /// TODO: whats a sensible default here? - #[default(512)] + /// Maximum size for user, community and site banner. Larger images are downscaled to fit + /// into a square of this size. + #[default(1024)] pub max_banner_size: u32, /// Prevent users from uploading images for posts or embedding in markdown. Avatars, icons and