ArthurHub / Android-Image-Cropper

Image Cropping Library for Android, optimized for Camera / Gallery.
Apache License 2.0
6.4k stars 1.37k forks source link

Not getting error when select different file. #200

Open altaf933 opened 7 years ago

altaf933 commented 7 years ago

When i am going to select different file but not an images it not return any error. Please consider this issue as enhancement.

We can set onActivityResult as Cancel or Error method so it will finish our current activity.

ArthurHub commented 7 years ago

I don't understand what you mean, you can't select non-image file...

altaf933 commented 7 years ago

I mean non images file if i do open it give a message like "Image load successful" but actually it is a another extension file so it should be an Error message. Checkout below reproducible step that may help .

GIF

ArthurHub commented 7 years ago

I'm curious, how common is this scenario? How it can happen in normal flow without using super user apps like file explorer?

altaf933 commented 7 years ago

My personal device Moto 2Generation have Camera,Gallery and Photo default android application if I will remove super users apps. Also it should a more option depend on the installed application.

ArthurHub commented 7 years ago

Sure, but camera, photos and gallery apps allow only valid image files. You can't select an apk to load...

altaf933 commented 7 years ago

Yes of course but user can select file by super user app (i.e File explorer) . Can we set any error message if file is not an images?

If Yes: We can fix this issue in BitmapCroppingWorkerTask.java file at onPostExecute by check result.bitmap==null that can set message like "Invalid images or choose image file only".

RaviLalwani556 commented 7 years ago

Any fix on the same ?

asos-davidf commented 7 years ago

Any fix underway? It's quite likely in a normal flow: Google Drive for instance can't restrict types of files shown, it will display everything.

thawatchai commented 6 years ago

Super user apps like File Explorer are built-in in most phones nowadays. Could you consider fixing this issue? Thank you very much.

BTW, do we have a way to work around when a user choose a non-image file?

arpitjoshi08 commented 6 years ago

I am getting same issue, its also able to select GIF file, how can i resolved this?