MediaStore.Images.Thumbnails.getThumbnail returns wrong thumbnail instead of NULL

后端 未结 2 1178
北海茫月
北海茫月 2021-02-19 19:23

Consider the scenario as in this picture:

Three photos, one of them is a large GIF file (3MP).

I\'m querying MediaStore in order to retrieve the corre

相关标签:
2条回答
  • 2021-02-19 19:58

    I"m just guessing here. When you ask for the MICRO_KIND the os is creating a new image which gets next in line on DESC cursor producing the same image again.

    One work around is to load an ArrayList for the image id's. Then to go after the thumbnails working from the ArrayList.

    Possibility try your code using the MINI_KIND and bmoptions.inSampleSize = 2;

     final BitmapFactory.Options bmOptions = new BitmapFactory.Options();
                bmOptions.inSampleSize =2;
    
    
    
                        Bitmap bm = MediaStore.Images.Thumbnails.getThumbnail(
                                context.getContentResolver(), newImageId,
                                MediaStore.Images.Thumbnails.MINI_KIND,
                                bmOptions);
    
    0 讨论(0)
  • 2021-02-19 20:03

    After three years, it seems that this issue is fixed in Lollipop. (The last comment on that thread).
    Therefore I'm answering my own question.

    0 讨论(0)
提交回复
热议问题