mirror of
https://github.com/chatmail/core.git
synced 2026-04-26 01:46:34 +03:00
Compress avatar to below 20k (#2384)
- Currently, group images are compressed as well because it was easier to implement that way. - Currently, in the unlikely case that the avatar is compressed down to 20x20 pixels but still bigger than 20KB, the user doesn't get any indication of this, the avatar simply isn't changed (at least on Android). If we want to change this, the easiest way is probably to let `dc_set_config()` in the ffi call `error!()` if `Selfavatar` can't be set. The same might make sense for some or all other configs. BUUUUUT: At least Android doesn't show error!() toasts anymore, probably because they were used too often and too spammy. - The factor by which we scale down if the file is too big is 1.5.
This commit is contained in:
@@ -2660,7 +2660,7 @@ pub async fn set_chat_profile_image(
|
||||
msg.param.remove(Param::Arg);
|
||||
msg.text = Some(stock_str::msg_grp_img_deleted(context, DC_CONTACT_ID_SELF as u32).await);
|
||||
} else {
|
||||
let image_blob = match BlobObject::from_path(context, Path::new(new_image.as_ref())) {
|
||||
let mut image_blob = match BlobObject::from_path(context, Path::new(new_image.as_ref())) {
|
||||
Ok(blob) => Ok(blob),
|
||||
Err(err) => match err {
|
||||
BlobError::WrongBlobdir { .. } => {
|
||||
|
||||
Reference in New Issue
Block a user