Skip to content

Commit

Permalink
Add another check of image resize maximums
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Jul 3, 2024
1 parent aa704f4 commit 64f2680
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gossip-lib/src/media.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,14 @@ impl Media {
pub(crate) fn load_image_bytes(
image_bytes: &[u8],
square: bool,
default_size: u32,
mut default_size: u32,
force_resize: bool,
round: bool,
) -> Result<RgbaImage, Error> {
let max_image_side = GLOBALS.max_image_side.load(Ordering::Relaxed) as u32;
if default_size > max_image_side {
default_size = max_image_side;
}
if let Ok(mut image) = image::load_from_memory(image_bytes) {
image = adjust_orientation(image_bytes, image);
if square {
Expand Down

0 comments on commit 64f2680

Please sign in to comment.