Use `image_matrix_limit` from instance configuration if available

This commit is contained in:
Grishka 2024-05-07 23:04:43 +03:00
parent bc78c61009
commit 97e16b9f73
1 changed files with 6 additions and 1 deletions

View File

@ -313,7 +313,12 @@ public class ComposeMediaViewController{
int maxSize=0; int maxSize=0;
String contentType=fragment.getActivity().getContentResolver().getType(attachment.uri); String contentType=fragment.getActivity().getContentResolver().getType(attachment.uri);
if(contentType!=null && contentType.startsWith("image/")){ if(contentType!=null && contentType.startsWith("image/")){
maxSize=2_073_600; // TODO get this from instance configuration when it gets added there Instance instance=fragment.instance;
if(instance.configuration!=null && instance.configuration.mediaAttachments!=null && instance.configuration.mediaAttachments.imageMatrixLimit>0){
maxSize=instance.configuration.mediaAttachments.imageMatrixLimit;
}else{
maxSize=2_073_600;
}
} }
attachment.progressBar.setProgress(0); attachment.progressBar.setProgress(0);
attachment.speedTracker.reset(); attachment.speedTracker.reset();