fix #760 changed/added contact photo has always low resolution

This commit is contained in:
Pavel Poley 2022-04-28 12:56:04 +03:00
parent a1cadedeaf
commit 53c443868a
1 changed files with 4 additions and 5 deletions

View File

@ -79,11 +79,10 @@ class LocalContactsHelper(val context: Context) {
val photoUri = Uri.parse(uri)
val bitmap = MediaStore.Images.Media.getBitmap(context.contentResolver, photoUri)
val thumbnailSize = context.getPhotoThumbnailSize()
val scaledPhoto = Bitmap.createScaledBitmap(bitmap, thumbnailSize * 2, thumbnailSize * 2, false)
val scaledSizePhotoData = scaledPhoto.getByteArray()
scaledPhoto.recycle()
return scaledSizePhotoData
val fullSizePhotoData = bitmap.getByteArray()
bitmap.recycle()
return fullSizePhotoData
}
private fun convertLocalContactToContact(localContact: LocalContact?, storedGroups: ArrayList<Group>): Contact? {