mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 17:06:35 +03:00
17
src/blob.rs
17
src/blob.rs
@@ -398,15 +398,14 @@ impl<'a> BlobObject<'a> {
|
|||||||
cause: err,
|
cause: err,
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let (img_wh, _quality) =
|
let img_wh = if MediaQuality::from_i32(context.get_config_int(Config::MediaQuality).await)
|
||||||
if MediaQuality::from_i32(context.get_config_int(Config::MediaQuality).await)
|
.unwrap_or_default()
|
||||||
.unwrap_or_default()
|
== MediaQuality::Balanced
|
||||||
== MediaQuality::Balanced
|
{
|
||||||
{
|
BALANCED_IMAGE_SIZE
|
||||||
(BALANCED_IMAGE_SIZE, BALANCED_IMAGE_QUALITY)
|
} else {
|
||||||
} else {
|
WORSE_IMAGE_SIZE
|
||||||
(WORSE_IMAGE_SIZE, WORSE_IMAGE_QUALITY)
|
};
|
||||||
};
|
|
||||||
|
|
||||||
if img.width() <= img_wh && img.height() <= img_wh {
|
if img.width() <= img_wh && img.height() <= img_wh {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|||||||
Reference in New Issue
Block a user