Skip to content

Commit

Permalink
fix ts bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutomic committed Dec 13, 2024
1 parent 60ba7af commit 7c771d2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions config/defaults.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
# 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.
max_banner_size: 512
}
# Email sending configuration. All options except login/password are mandatory
Expand Down
4 changes: 4 additions & 0 deletions crates/api_common/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use url::Url;
#[cfg_attr(feature = "full", derive(TS))]
#[cfg_attr(feature = "full", ts(export))]
pub struct ImageGetParams {
#[cfg_attr(feature = "full", ts(optional))]
pub file_type: Option<String>,
#[cfg_attr(feature = "full", ts(optional))]
pub max_size: Option<i32>,
}

Expand All @@ -27,7 +29,9 @@ pub struct DeleteImageParams {
#[cfg_attr(feature = "full", ts(export))]
pub struct ImageProxyParams {
pub url: String,
#[cfg_attr(feature = "full", ts(optional))]
pub file_type: Option<String>,
#[cfg_attr(feature = "full", ts(optional))]
pub max_size: Option<i32>,
}

Expand Down
4 changes: 2 additions & 2 deletions crates/utils/src/settings/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ pub struct PictrsConfig {
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.
///
/// 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.
#[default(512)]
Expand Down

0 comments on commit 7c771d2

Please sign in to comment.