Skip to content

Commit 6ce9415

Browse files
committed
feat: Do not scale images down by a small amount
1 parent b0cfdc2 commit 6ce9415

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/blob.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,11 @@ impl<'a> BlobObject<'a> {
450450
max_wh
451451
};
452452

453-
if target_wh > n_px_longest_side {
453+
// TODO: Increase the multiplier (something between 0.95 and 0.99 seems appropriate),
454+
// when a better resampling-function than `thumbnail` is used.
455+
if target_wh > n_px_longest_side
456+
|| !is_avatar && target_wh > (f64::from(n_px_longest_side) * 0.89) as u32
457+
{
454458
target_wh = n_px_longest_side;
455459
};
456460

0 commit comments

Comments
 (0)