|
1 | 1 | package com.w2sv.cropbundle |
2 | 2 |
|
3 | 3 | import android.content.ContentResolver |
4 | | -import android.content.Context |
5 | 4 | import android.graphics.Bitmap |
6 | 5 | import android.net.Uri |
7 | 6 | import android.os.Parcelable |
8 | 7 | import android.provider.MediaStore |
9 | | -import androidx.core.database.getLongOrNull |
10 | | -import com.w2sv.cropbundle.cropping.model.CropEdges |
11 | 8 | import com.w2sv.cropbundle.cropping.CropSensitivity |
12 | 9 | import com.w2sv.cropbundle.cropping.crop |
13 | 10 | import com.w2sv.cropbundle.cropping.cropped |
| 11 | +import com.w2sv.cropbundle.cropping.model.CropEdges |
14 | 12 | import com.w2sv.cropbundle.io.ImageMimeType |
15 | 13 | import com.w2sv.cropbundle.io.extensions.loadBitmap |
16 | 14 | import com.w2sv.cropbundle.io.extensions.queryMediaStoreData |
@@ -106,16 +104,14 @@ data class Screenshot( |
106 | 104 | MediaStore.Images.Media.SIZE, |
107 | 105 | MediaStore.Images.Media.DISPLAY_NAME, |
108 | 106 | MediaStore.Images.Media.MIME_TYPE, |
109 | | - MediaStore.Images.Media._ID |
110 | 107 | ), |
111 | 108 | onCursor = { |
112 | 109 | val fileName = it.getString(it.getColumnIndexOrThrow(MediaStore.Images.Media.DISPLAY_NAME)) |
113 | 110 | MediaStoreData( |
114 | 111 | diskUsage = it.getLong(it.getColumnIndexOrThrow(MediaStore.Images.Media.SIZE)), |
115 | 112 | fileName = fileName, |
116 | 113 | mimeType = ImageMimeType.parse(it.getString(it.getColumnIndexOrThrow(MediaStore.Images.Media.MIME_TYPE))), |
117 | | - id = it.getLongOrNull(it.getColumnIndexOrThrow(MediaStore.Images.Media._ID)) |
118 | | - ?: fileName.substringBeforeLast(".").toLong() // TODO: probably still unreliable |
| 114 | + id = fileName.substringBeforeLast(".").toLong() // TODO: probably still unreliable |
119 | 115 | ) |
120 | 116 | .also { i { it.toString() } } |
121 | 117 | } |
|
0 commit comments