Have you found a way to benefit from the MINI_THUMB_MAGIC column without doing a second query to access the thumbnails?
On Saturday, January 2, 2010 12:06:54 PM UTC-8, CaptainSpam wrote: > > In an app I'm developing, I have a need to list the images stored on > the device in a Gallery widget. In a base sense, I've got that much > working; I can get thumbnails of everything via a query on > MediaStore.Images.Thumbnails, display them using an ImageAdapter, and > get the corresponding image IDs so I can retrieve the correct image > from MediaStore.Images.Media when the user selects it. That's all > fine and good. > > The problem, however, is that I want this image list sorted first by > bucket (and, for convenience, make sure Camera comes first), then by > the date the image was taken (or, failing that, when the image was > added). Where this comes into a problem is that I can't query on > these parameters when using MediaStore.Images.Thumbnails, and I don't > think it's possible to do an SQL JOIN between two content providers > (which makes sense, really) so I can match up thumbnail IDs to image > IDs. So, I can't directly get the thumbnails if I'm querying by > MediaStore.Images.Media, is what I'm saying. > > Looking over the docs, I'm noticing that MINI_THUMB_MAGIC is a part of > MediaStore.Images.Media (inherited from ImageColumns), and that it > should, if I'm understanding it right, give me the mini-sized > thumbnail ID for the specified image. However, when I look that value > up, I get a massive, 64-bit value (in this case, 4159546474444162379) > that, while it appears to be consistent in that the same image keeps > giving the same value, doesn't appear to be accepted by the thumbnail > content provider (it just tells me that the image can't be found). > > So what I'm asking is, how do I use > MediaStore.Images.Media.MINI_THUMB_MAGIC to get a thumbnail, if I > can? I can think of a way around this involving a second query every > time I want a thumbnail (ask the thumbnail content provider to look up > the thumbnail ID given a specific IMAGE_ID and indicating I only want > the mini thumbnail), but that seems horribly inefficient for something > like this. > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

