mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-04 03:43:55 +01:00
Added option for automatically resizing of images
This commit is contained in:
6
FAQ.md
6
FAQ.md
@@ -985,9 +985,11 @@ If your provider requires an unsupported authentication method, you'll likely ge
|
|||||||
<a name="faq63"></a>
|
<a name="faq63"></a>
|
||||||
**(63) How are images resized for displaying on screens?**
|
**(63) How are images resized for displaying on screens?**
|
||||||
|
|
||||||
After adding an inline image or an image attachment you might be asked if you want to reduce the image size for displaying on a screens.
|
Large inline or attached images will automatically be resized for displaying on screens.
|
||||||
If you answer "yes", the image will be resized to a maximum width and height of about 1920 pixels and saved with a compression ratio of 90 out of 100.
|
This is because email messages are limited in size, depending on the provider mostly between 10 and 50 MB.
|
||||||
|
Image will be resized to a maximum width and height of about 1280 pixels and saved with a compression ratio of 90 out of 100.
|
||||||
Images are scaled down using whole number factors to reduce memory usage and to retain image quality.
|
Images are scaled down using whole number factors to reduce memory usage and to retain image quality.
|
||||||
|
There is an advanced option to disable automatically resizing of image attachments.
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
|||||||
@@ -1312,7 +1312,10 @@ public class FragmentCompose extends FragmentEx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image &&
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
boolean autoresize = prefs.getBoolean("autoresize", true);
|
||||||
|
|
||||||
|
if ((image || autoresize) &&
|
||||||
("image/jpeg".equals(attachment.type) || "image/png".equals(attachment.type))) {
|
("image/jpeg".equals(attachment.type) || "image/png".equals(attachment.type))) {
|
||||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||||
options.inJustDecodeBounds = true;
|
options.inJustDecodeBounds = true;
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS
|
|||||||
private SwitchCompat swAutoMove;
|
private SwitchCompat swAutoMove;
|
||||||
private SwitchCompat swConfirm;
|
private SwitchCompat swConfirm;
|
||||||
private SwitchCompat swSender;
|
private SwitchCompat swSender;
|
||||||
|
private SwitchCompat swAutoResize;
|
||||||
private SwitchCompat swAutoSend;
|
private SwitchCompat swAutoSend;
|
||||||
|
|
||||||
private SwitchCompat swLight;
|
private SwitchCompat swLight;
|
||||||
@@ -118,6 +119,7 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS
|
|||||||
swAutoMove = view.findViewById(R.id.swAutoMove);
|
swAutoMove = view.findViewById(R.id.swAutoMove);
|
||||||
swConfirm = view.findViewById(R.id.swConfirm);
|
swConfirm = view.findViewById(R.id.swConfirm);
|
||||||
swSender = view.findViewById(R.id.swSender);
|
swSender = view.findViewById(R.id.swSender);
|
||||||
|
swAutoResize = view.findViewById(R.id.swAutoResize);
|
||||||
swAutoSend = view.findViewById(R.id.swAutoSend);
|
swAutoSend = view.findViewById(R.id.swAutoSend);
|
||||||
|
|
||||||
swLight = view.findViewById(R.id.swLight);
|
swLight = view.findViewById(R.id.swLight);
|
||||||
@@ -348,6 +350,14 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
swAutoResize.setChecked(prefs.getBoolean("autoresize", true));
|
||||||
|
swAutoResize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||||
|
prefs.edit().putBoolean("autoresize", checked).apply();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
swAutoSend.setChecked(!prefs.getBoolean("autosend", false));
|
swAutoSend.setChecked(!prefs.getBoolean("autosend", false));
|
||||||
swAutoSend.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
swAutoSend.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -444,6 +444,18 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/swSender" />
|
app:layout_constraintTop_toBottomOf="@id/swSender" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
|
android:id="@+id/swAutoResize"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:text="@string/title_advanced_autoresize"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tvSenderHint"
|
||||||
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
android:id="@+id/swAutoSend"
|
android:id="@+id/swAutoSend"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -453,7 +465,7 @@
|
|||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="12dp"
|
||||||
android:text="@string/title_advanced_autosend"
|
android:text="@string/title_advanced_autosend"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvSenderHint"
|
app:layout_constraintTop_toBottomOf="@id/swAutoResize"
|
||||||
app:switchPadding="12dp" />
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
|
|||||||
@@ -143,6 +143,7 @@
|
|||||||
<string name="title_advanced_automove">Confirm moving messages</string>
|
<string name="title_advanced_automove">Confirm moving messages</string>
|
||||||
<string name="title_advanced_confirm">Confirm actions that might leak privacy sensitive information</string>
|
<string name="title_advanced_confirm">Confirm actions that might leak privacy sensitive information</string>
|
||||||
<string name="title_advanced_sender">Allow editing sender address</string>
|
<string name="title_advanced_sender">Allow editing sender address</string>
|
||||||
|
<string name="title_advanced_autoresize">Automatically resize images for displaying on screens</string>
|
||||||
<string name="title_advanced_autosend">Confirm sending messages</string>
|
<string name="title_advanced_autosend">Confirm sending messages</string>
|
||||||
|
|
||||||
<string name="title_advanced_updates">Check for updates</string>
|
<string name="title_advanced_updates">Check for updates</string>
|
||||||
@@ -319,7 +320,6 @@
|
|||||||
<string name="title_send">Send</string>
|
<string name="title_send">Send</string>
|
||||||
<string name="title_view">View</string>
|
<string name="title_view">View</string>
|
||||||
<string name="title_send_after">Send after …</string>
|
<string name="title_send_after">Send after …</string>
|
||||||
<string name="title_ask_resize">Reduce size of %1$s for displaying on screens?</string>
|
|
||||||
|
|
||||||
<string name="title_no_selection">Nothing selected</string>
|
<string name="title_no_selection">Nothing selected</string>
|
||||||
<string name="title_style_bold">Bold</string>
|
<string name="title_style_bold">Bold</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user