|
|
|
@ -5198,11 +5198,17 @@ 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/jpg".equals(attachment.type) ||
|
|
|
|
|
"image/jpeg".equals(attachment.type) ||
|
|
|
|
|
"image/png".equals(attachment.type) ||
|
|
|
|
|
"image/webp".equals(attachment.type))) {
|
|
|
|
|
if (!file.exists()) // Upload cancelled;
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!"image/jpg".equals(attachment.type) &&
|
|
|
|
|
!"image/jpeg".equals(attachment.type) &&
|
|
|
|
|
!"image/png".equals(attachment.type) &&
|
|
|
|
|
!"image/webp".equals(attachment.type)) {
|
|
|
|
|
Log.i("Skipping resize of type=" + attachment.type);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExifInterface exifSaved;
|
|
|
|
|
try {
|
|
|
|
|
exifSaved = new ExifInterface(file);
|
|
|
|
@ -5296,7 +5302,6 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private SimpleTask<DraftData> draftLoader = new SimpleTask<DraftData>() {
|
|
|
|
|
@Override
|
|
|
|
|