-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UIL unable to load image when source is PHOTO_URI of contact #564
Comments
You can try to extend @Override
protected InputStream getStreamFromContent(String imageUri, Object extra) throws FileNotFoundException {
ContentResolver res = context.getContentResolver();
Uri uri = Uri.parse(imageUri);
if (imageUri.startsWith("content://com.android.contacts/")) {
return ContactsContract.Contacts.openContactPhotoInputStream(res, uri);
} else {
return res.openInputStream(uri);
}
} |
looks like this works. thanks whether it will be integrated within this library ? 2014-03-11 21:36 GMT+02:00 Sergey Tarasevich notifications@github.com:
|
Maybe. Let me think about it. |
Strange, but at the same time , such uri : content://com.android.contacts/contacts/9/photo_166x170 loaded without problems and without code changes you suggested. ok, so far I've found the pattern : these , doesn't : and each time it fails I see in logcat right before the error message : |
I see that the master branch has been updated to correct this, are you going to release a new .jar file for it? Thanks! |
I'm going to but I can't say the date of release. |
Done in 1.9.2. |
for example :
uri : content://com.android.contacts/display_photo/2
this code fails :
ImageLoader.getInstance().displayImage(phoneContact.getImageURI(), photo);
with the following error :
E/ImageLoader(13761): Image can't be decoded [content://com.android.contacts/display_photo/2_480x800]
at the same time , this code :
photo.setImageBitmap(android.provider.MediaStore.Images.Media.getBitmap(this.getContentResolver(),Uri.parse(phoneContact.getImageURI())));
works as excpected.
The text was updated successfully, but these errors were encountered: