fresco icon indicating copy to clipboard operation
fresco copied to clipboard

LocalContentUriThumbnailFetchProducer not working for Android SDK>=29

Open kenckyuan opened this issue 4 years ago • 3 comments

Description

When using URI to load local images with ResizeOptions, eg.

Uri uri = Uri.parse("content://media/external/images/media/" + imageId);
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri)
                .setResizeOptions(new ResizeOptions(100, 100))
                .build();
frescoView.setImageRequest(request);

LocalContentUriThumbnailFetchProducer is always used first. LocalContentUriThumbnailFetchProducer try to getThumbnail by MediaStore.Images.Thumbnails which was deprecated in API level 29. LocalContentUriThumbnailFetchProducer calls ContentResolver#query twice,

query("content://media/.../{id}")
query("content://media/.../thumbnails")

but has no effect when SDK>=29.

Potential Side Effects

  1. Performance downgrade
  2. Log by AppOpsManager,causing privacy concerns

Solution

For SDK>=29, ContentResolver#loadThumbnails

Additional Information

  • Fresco version: 2.5.0
  • Platform version: Android SDK>=29

kenckyuan avatar Jul 04 '21 02:07 kenckyuan

but has no effect when SDK>=29. -- is maybe wrong,need for research

kenckyuan avatar Jul 09 '21 10:07 kenckyuan

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug" or "enhancement" and I will leave it open. Thank you for your contributions.

stale[bot] avatar Jan 09 '22 04:01 stale[bot]

I created an new issue and maybe it's related to this one. Please check here Video Thumbnail creation not working in Android 11 - https://github.com/facebook/fresco/issues/2655 and mark as duplicated if you think it's the case.

pdalfarr avatar Feb 11 '22 16:02 pdalfarr