T Lam
T Lam

Reputation: 162

Android thumbnail generation differs between MINI_KIND and MICRO_KIND

I am currently working on an application that lists all the images (thumbnails) on the device's sdcard. Here is a code snippet:

final String[] imageColumns = {MediaStore.Images.Media.DATA};
imageCursor = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, imageColumns, null, null, null);
imageColumnIndex = imageCursor.getColumnIndex(MediaStore.Images.Media._ID);
Bitmap bm = MediaStore.Images.Thumbnails.getThumbnail(getApplication().getContentResolver(),
            imageCursor.getInt(imageColumnIndex),MediaStore.Images.Thumbnails.MICRO_KIND, null);

The issue I am seeing is that the image displayed is not the thumbnail of the big image. Moreover, if I make the call to MINI_KIND instead, I am getting the right thumbnail. I am currently testing this on a HTC Aria. Since the application needs to support 2.1 (API level 7), I cannot take use of the ThumbnailUtil class.

Any advice would be beneficial?

Upvotes: 3

Views: 1535

Answers (1)

T Lam
T Lam

Reputation: 162

It seems like the thumbnail database where MINI_KIND is getting the images from was corrupted in the database. Deleting the files from the SD Card seems to resolve the issue.

Upvotes: 2

Related Questions