store attachment uri as a string
This commit is contained in:
parent
ceb9896988
commit
4cad413478
5 changed files with 9 additions and 7 deletions
|
|
@ -146,12 +146,12 @@ class ThreadActivity : SimpleActivity() {
|
|||
if (it.mimetype.startsWith("image/")) {
|
||||
val fileOptions = BitmapFactory.Options()
|
||||
fileOptions.inJustDecodeBounds = true
|
||||
BitmapFactory.decodeStream(contentResolver.openInputStream(it.uri), null, fileOptions)
|
||||
BitmapFactory.decodeStream(contentResolver.openInputStream(it.getUri()), null, fileOptions)
|
||||
it.width = fileOptions.outWidth
|
||||
it.height = fileOptions.outHeight
|
||||
} else if (it.mimetype.startsWith("video/")) {
|
||||
val metaRetriever = MediaMetadataRetriever()
|
||||
metaRetriever.setDataSource(this, it.uri)
|
||||
metaRetriever.setDataSource(this, it.getUri())
|
||||
it.width = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH)!!.toInt()
|
||||
it.height = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT)!!.toInt()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue