Fixed resizing of image/jpg

This commit is contained in:
M66B 2023-12-03 19:52:03 +01:00
parent c3e98b4c4d
commit 970abd34f9
1 changed files with 4 additions and 2 deletions

View File

@ -5199,7 +5199,8 @@ public class FragmentCompose extends FragmentBase {
private static void resizeAttachment(Context context, EntityAttachment attachment, int resize) throws IOException { private static void resizeAttachment(Context context, EntityAttachment attachment, int resize) throws IOException {
File file = attachment.getFile(context); File file = attachment.getFile(context);
if (file.exists() /* upload cancelled */ && 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/png".equals(attachment.type) ||
"image/webp".equals(attachment.type))) { "image/webp".equals(attachment.type))) {
ExifInterface exifSaved; ExifInterface exifSaved;
@ -5237,7 +5238,8 @@ public class FragmentCompose extends FragmentBase {
} }
Bitmap.CompressFormat format; Bitmap.CompressFormat format;
if ("image/jpeg".equals(attachment.type)) if ("image/jpg".equals(attachment.type) ||
"image/jpeg".equals(attachment.type))
format = Bitmap.CompressFormat.JPEG; format = Bitmap.CompressFormat.JPEG;
else if ("image/png".equals(attachment.type)) else if ("image/png".equals(attachment.type))
format = Bitmap.CompressFormat.PNG; format = Bitmap.CompressFormat.PNG;