From 970abd34f9752fa3e075b20b0a393c60640b37cb Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 3 Dec 2023 19:52:03 +0100 Subject: [PATCH] Fixed resizing of image/jpg --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 5e86b17bf0..cc686a3620 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -5199,7 +5199,8 @@ public class FragmentCompose extends FragmentBase { private static void resizeAttachment(Context context, EntityAttachment attachment, int resize) throws IOException { File file = attachment.getFile(context); if (file.exists() /* upload cancelled */ && - ("image/jpeg".equals(attachment.type) || + ("image/jpg".equals(attachment.type) || + "image/jpeg".equals(attachment.type) || "image/png".equals(attachment.type) || "image/webp".equals(attachment.type))) { ExifInterface exifSaved; @@ -5237,7 +5238,8 @@ public class FragmentCompose extends FragmentBase { } Bitmap.CompressFormat format; - if ("image/jpeg".equals(attachment.type)) + if ("image/jpg".equals(attachment.type) || + "image/jpeg".equals(attachment.type)) format = Bitmap.CompressFormat.JPEG; else if ("image/png".equals(attachment.type)) format = Bitmap.CompressFormat.PNG;