Backend for setting identity and contact pictures

Pictures are not saved correctly, something is corrupting them.
This commit is contained in:
str4d
2014-05-16 09:33:28 +00:00
parent 2a4100d82d
commit 108096e022
7 changed files with 142 additions and 17 deletions

View File

@@ -116,8 +116,11 @@ public class BoteHelper extends GeneralHelper {
}
public static String encodePicture(Bitmap picture) {
if (picture == null)
return null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
boolean success = picture.compress(CompressFormat.PNG, 100, baos);
// TODO something is corrupting here
picture.compress(CompressFormat.PNG, 0, baos);
return Base64.encodeToString(baos.toByteArray(), Base64.DEFAULT);
}
}