mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-09 21:56:20 +00:00
Improved SVG support
This commit is contained in:
parent
7463baf313
commit
1c7cfdfc40
1 changed files with 5 additions and 3 deletions
|
@ -490,7 +490,8 @@ class ImageHelper {
|
||||||
try {
|
try {
|
||||||
if (slow)
|
if (slow)
|
||||||
semaphore.acquire();
|
semaphore.acquire();
|
||||||
d = downloadImage(context, id, source, null);
|
String mimeType = (source.endsWith(".svg") ? "image/svg+xml" : null);
|
||||||
|
d = downloadImage(context, id, source, mimeType);
|
||||||
} finally {
|
} finally {
|
||||||
if (slow)
|
if (slow)
|
||||||
semaphore.release();
|
semaphore.release();
|
||||||
|
@ -645,7 +646,8 @@ class ImageHelper {
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
|
||||||
try {
|
try {
|
||||||
return getScaledDrawable(context, file, null, dm.widthPixels);
|
String mimeType = (source.endsWith(".svg") ? "image/svg+xml" : null);
|
||||||
|
return getScaledDrawable(context, file, mimeType, dm.widthPixels);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Log.i(ex);
|
Log.i(ex);
|
||||||
return null;
|
return null;
|
||||||
|
@ -680,7 +682,7 @@ class ImageHelper {
|
||||||
try (FileOutputStream fos = new FileOutputStream(file)) {
|
try (FileOutputStream fos = new FileOutputStream(file)) {
|
||||||
Helper.copy(urlConnection.getInputStream(), fos);
|
Helper.copy(urlConnection.getInputStream(), fos);
|
||||||
}
|
}
|
||||||
return getScaledDrawable(context, file, null, dm.widthPixels);
|
return getScaledDrawable(context, file, mimeType, dm.widthPixels);
|
||||||
}
|
}
|
||||||
|
|
||||||
bm = getScaledBitmap(
|
bm = getScaledBitmap(
|
||||||
|
|
Loading…
Add table
Reference in a new issue