igreenwood / SimpleCropView

A simple image cropping library for Android.
MIT License
2.48k stars 465 forks source link

Bugs in api level higher than 23 #124

Closed igreenwood closed 6 years ago

igreenwood commented 6 years ago
igreenwood commented 6 years ago

It seems like an emulator bug.

i3130002 commented 6 years ago

It seems like an emulator bug.

@IsseiAoki

That would be great if you push a fix for that

i3130002 commented 6 years ago

According to link you'd better not to use url to path. I was able to load image using this code (instead of cropView.load(uri).execute(null) )

InputStream input;
Bitmap bmp;
try {
    input = getApplicationContext().getContentResolver().openInputStream(img);
    bmp = BitmapFactory.decodeStream(input);
    cropImageView.setImageBitmap(bmp);
} catch (FileNotFoundException e1) {
    e1.printStackTrace();
}

So I suggest to replace load method getting parameter context and fix the issue