blob: b000c0557bc2f0ab65cb76915c17596be16912f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package eu.siacs.conversations.xmpp.pep;
import android.util.Base64;
public class Avatar {
public String type;
public String sha1sum;
public String image;
public int height;
public int width;
public long size;
public byte[] getImageAsBytes() {
return Base64.decode(image, Base64.DEFAULT);
}
public String getFilename() {
if (type==null) {
return sha1sum;
} else if (type.equalsIgnoreCase("image/webp")) {
return sha1sum+".webp";
} else if (type.equalsIgnoreCase("image/png")) {
return sha1sum+".png";
} else {
return sha1sum;
}
}
}
|