Added debug option to turn off webp

This commit is contained in:
M66B
2023-09-30 07:37:05 +02:00
parent 8079a14fd3
commit a38ca28ee5
5 changed files with 44 additions and 3 deletions

View File

@@ -318,6 +318,7 @@ class ImageHelper {
boolean show, int zoom, final float scale, final TextView view) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean inline = prefs.getBoolean("inline_images", false);
boolean webp = prefs.getBoolean("webp", true);
final int px = Helper.dp2pixels(context, (zoom + 1) * 24);
final Resources res = context.getResources();
@@ -345,6 +346,10 @@ class ImageHelper {
Drawable d = ContextCompat.getDrawable(context, R.drawable.twotone_broken_image_24);
d.setBounds(0, 0, px, px);
return d;
} else if ("image/webp".equalsIgnoreCase(attachment.type) && !webp) {
Drawable d = ContextCompat.getDrawable(context, R.drawable.twotone_warning_24);
d.setBounds(0, 0, px, px);
return d;
} else if (!attachment.available) {
Log.i("Image not available CID=" + cid);
Drawable d = ContextCompat.getDrawable(context, R.drawable.twotone_photo_library_24);