mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +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);
|
||||
Options options = new Options();
|
||||
options.inSampleSize = inSampleSize;
|
||||
if (contentType.equals("image/png"))
|
||||
options.inPreferredConfig = Bitmap.Config.RGB_565;
|
||||
Bitmap bitmap = decodeStream(is, null, options);
|
||||
if (bitmap == null) throw new IOException();
|
||||
return bitmap;
|
||||
|
||||
Reference in New Issue
Block a user