Do not compress GIFs (#1616, #1254)

This commit is contained in:
Benoit Marty 2020-12-01 17:55:37 +01:00 committed by Benoit Marty
parent 439029467a
commit 21271b6510
2 changed files with 5 additions and 1 deletions

View file

@ -16,6 +16,7 @@ Bugfix 🐛:
- Double bottomsheet effect after verify with passphrase
- EditText cursor jumps to the start while typing fast (#2469)
- Show preview when sending attachment from the keyboard (#2440)
- Do not compress GIFs (#1616, #1254)
Translations 🗣:
-

View file

@ -151,7 +151,10 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter
params.attachment.size
)
if (attachment.type == ContentAttachmentData.Type.IMAGE && params.compressBeforeSending) {
if (attachment.type == ContentAttachmentData.Type.IMAGE
// Do not compress gif
&& attachment.mimeType != "image/gif"
&& params.compressBeforeSending) {
fileToUpload = imageCompressor.compress(context, workingFile, MAX_IMAGE_SIZE, MAX_IMAGE_SIZE)
.also { compressedFile ->
// Get new Bitmap size