Fixed resizing of image/jpg

pull/214/head
M66B 11 months ago
parent c3e98b4c4d
commit 970abd34f9

@ -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;

Loading…
Cancel
Save