ImagePicker
ImagePicker copied to clipboard
Image type change from jpg to png if compress in enabled
Summary
If we set the compress option or maxResultSize option, the file extension changes to PNG from anyother type
Code to reproduce
The issue is because of this line
fun getTempFile(context: Context, uri: Uri): File? {
try {
val destination = File(context.cacheDir, "image_picker.png")
val parcelFileDescriptor = context.contentResolver.openFileDescriptor(uri, "r")
val fileDescriptor = parcelFileDescriptor?.fileDescriptor ?: return null
....
We should consider uri field type before creating temp file.
Android version
All versions
Impacted devices
All
Installation method
Gradle
SDK version
n/a