mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 14:49:53 +01:00
[android] Fix PNG compression with different BitmapConfig
Source: https://stackoverflow.com/a/6140360
This commit is contained in:
@@ -172,6 +172,8 @@ class AttachmentCreationTask {
|
|||||||
LOG.info("Scaling attachment by factor of " + inSampleSize);
|
LOG.info("Scaling attachment by factor of " + inSampleSize);
|
||||||
Options options = new Options();
|
Options options = new Options();
|
||||||
options.inSampleSize = inSampleSize;
|
options.inSampleSize = inSampleSize;
|
||||||
|
if (contentType.equals("image/png"))
|
||||||
|
options.inPreferredConfig = Bitmap.Config.RGB_565;
|
||||||
Bitmap bitmap = decodeStream(is, null, options);
|
Bitmap bitmap = decodeStream(is, null, options);
|
||||||
if (bitmap == null) throw new IOException();
|
if (bitmap == null) throw new IOException();
|
||||||
return bitmap;
|
return bitmap;
|
||||||
|
|||||||
Reference in New Issue
Block a user