File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -193,8 +193,9 @@ pub(crate) const WORSE_AVATAR_BYTES: usize = 20_000; // this also fits to Outloo
193
193
pub const BALANCED_IMAGE_SIZE : u32 = 1280 ;
194
194
pub const WORSE_IMAGE_SIZE : u32 = 640 ;
195
195
196
- // Limit displayed images ~8.3 megapixels (3840 × 2160)
197
- pub const MAX_IMAGE_PIXELS : u32 = 8294400 ;
196
+ /// Limit for received images size. Bigger images become `Viewtype::File` to avoid excessive memory
197
+ /// usage by UIs.
198
+ pub const MAX_RCVD_IMAGE_PIXELS : u32 = 35_000_000 ;
198
199
199
200
// Key for the folder configuration version (see below).
200
201
pub ( crate ) const DC_FOLDERS_CONFIGURED_KEY : & str = "folders_configured" ;
Original file line number Diff line number Diff line change @@ -1386,7 +1386,7 @@ impl MimeMessage {
1386
1386
{
1387
1387
match get_filemeta ( decoded_data) {
1388
1388
// image size is known, not too big, keep msg_type:
1389
- Ok ( ( width, height) ) if width * height <= constants:: MAX_IMAGE_PIXELS => {
1389
+ Ok ( ( width, height) ) if width * height <= constants:: MAX_RCVD_IMAGE_PIXELS => {
1390
1390
part. param . set_i64 ( Param :: Width , width. into ( ) ) ;
1391
1391
part. param . set_i64 ( Param :: Height , height. into ( ) ) ;
1392
1392
msg_type
You can’t perform that action at this time.
0 commit comments