Update src/blob.rs

Co-authored-by: Hocuri <hocuri@gmx.de>
This commit is contained in:
bjoern
2020-06-07 15:37:05 +02:00
committed by B. Petersen
parent d5ea4f9b1a
commit 34c69785d0

View File

@@ -398,14 +398,13 @@ 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_QUALITY) BALANCED_IMAGE_SIZE
} else { } else {
(WORSE_IMAGE_SIZE, WORSE_IMAGE_QUALITY) WORSE_IMAGE_SIZE
}; };
if img.width() <= img_wh && img.height() <= img_wh { if img.width() <= img_wh && img.height() <= img_wh {