Tourenathan-G5organisation / SiliCompressor

A powerful, flexible and easy to use Video and Image compression library for Android.
Apache License 2.0
1.38k stars 292 forks source link

Crash when selecting file from Recents of files app (com.android.documentsui) #157

Open DarkAbhi opened 4 years ago

DarkAbhi commented 4 years ago

2020-09-12 04:21:27.037 27444-27444/com.iku.test E/BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Restored/IMG_20200831_171122.jpg (No such file or directory) 2020-09-12 04:21:27.038 27444-27444/com.test D/AndroidRuntime: Shutting down VM 2020-09-12 04:21:27.040 27444-27444/com.test E/AndroidRuntime: FATAL EXCEPTION: main Process: com.iku.test, PID: 27444 java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/image:163086 flg=0x1 }} to activity {com.test/com.test.ImageActivity}: java.lang.ArithmeticException: divide by zero at android.app.ActivityThread.deliverResults(ActivityThread.java:4401)

When selecting image from files app from recents section app crashes with above error

String filePath = SiliCompressor.with(getApplicationContext()).compress(FileUtils.getPath(this,mImageUri),new File(this.getCacheDir(),"temp"),true);