Tell us which versions you are using:
Tell us to which platform this issue is related
file:///storage/emulated/0/Android/data/com.techo2/cache/photo-2009714323
file:///storage/emulated/0/Android/data/com.techo2/cache/undefined
// stacktrace or any other useful debug info
Love react-native-image-crop-picker? Please consider supporting our collective:
馃憠 https://opencollective.com/react-native-image-crop-picker/donate
Same here.
filename attribute is missing from the image on Android platform.
If we try to hack around it and extract the name from path, the name from path is not the same as selected image's name.
It is working fine for me.
I used filnename= path.substring(item.path.lastIndexOf('/') + 1), to get the selected image name from its path
Hi @NeerajaaG and @ivpusic any solution to this yet? Am getting the following error, when trying to pick an image from download folder. It works Ok in the camera folder path: /storage/~/0/DCIM/Camera/... but not with /storage/~/0/Download/...
It's saying something about exifinterface, and I tried referencing the latest exifinterface from com.android.support (28+) and androidx.exifinterface (1.1.0 beta) in my build.gradle file. Could you help with this? Could this be from the cropping lib used in this package?
08-04 03:55:19.057 6850 6880 I ExifInterface_JNI: Raw image not detected
08-04 03:55:19.060 6850 6880 W ExifInterface: Invalid image: ExifInterface got an unsupported image format file(ExifInterface supports JPEG and some RAW image formats only) or a corrupted JPEG file to ExifInterface.
08-04 03:55:19.060 6850 6880 W ExifInterface: java.io.IOException: Invalid marker: 52
08-04 03:55:19.060 6850 6880 W ExifInterface: at android.media.ExifInterface.getJpegAttributes(ExifInterface.java:1835)
08-04 03:55:19.060 6850 6880 W ExifInterface: at android.media.ExifInterface.loadAttributes(ExifInterface.java:1475)
08-04 03:55:19.060 6850 6880 W ExifInterface: at android.media.ExifInterface.
08-04 03:55:19.060 6850 6880 W ExifInterface: at com.yalantis.ucrop.task.BitmapCropTask.crop(BitmapCropTask.java:131)
08-04 03:55:19.060 6850 6880 W ExifInterface: at com.yalantis.ucrop.task.BitmapCropTask.doInBackground(BitmapCropTask.java:91)
08-04 03:55:19.060 6850 6880 W ExifInterface: at com.yalantis.ucrop.task.BitmapCropTask.doInBackground(BitmapCropTask.java:30)
08-04 03:55:19.060 6850 6880 W ExifInterface: at android.os.AsyncTask$2.call(AsyncTask.java:305)
08-04 03:55:19.060 6850 6880 W ExifInterface: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
08-04 03:55:19.060 6850 6880 W ExifInterface: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
08-04 03:55:19.060 6850 6880 W ExifInterface: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
08-04 03:55:19.060 6850 6880 W ExifInterface: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
08-04 03:55:19.060 6850 6880 W ExifInterface: at java.lang.Thread.run(Thread.java:761)
08-04 03:55:19.060 6850 6880 I BitmapCropTask: Should crop: true
08-04 03:55:19.061 6850 6880 D uCrop JNI: Crop image with CImg
08-04 03:55:19.133 6850 6850 E image-crop-picker: Promise rejected. Cannot find image data
08-04 03:55:19.152 6850 6907 I ReactNativeJS: 'error picking image', { [Error: Cannot find image data]
08-04 03:55:19.152 6850 6907 I ReactNativeJS: framesToPop: 1,
08-04 03:55:19.152 6850 6907 I ReactNativeJS: nativeStackAndroid: [],
08-04 03:55:19.152 6850 6907 I ReactNativeJS: userInfo: null,
08-04 03:55:19.152 6850 6907 I ReactNativeJS: code: 'E_NO_IMAGE_DATA_FOUND',
08-04 03:55:19.152 6850 6907 I ReactNativeJS: line: 2116,
08-04 03:55:19.152 6850 6907 I ReactNativeJS: column: 26,
@NeerajaaG and @ivpusic you can follow up with progress here. Thanks!
Is this resolved? still can't get filename on android
same here, no filename going to use @NeerajaaG method ..
filnename= path.substring(item.path.lastIndexOf('/') + 1)
Most helpful comment
It is working fine for me.
I used filnename= path.substring(item.path.lastIndexOf('/') + 1), to get the selected image name from its path