No. You have to do this all yourself :( 1. Query from the mediastore all the info for your original image, including its file-path (DATA column). 2. Query from the thumbnail mediastore the info of all the thumbnails (can have more than one) for the given image.
3. Copy your image-file to another location. Remember this location for the new DATA column of your new image. 4. Insert into the mediastore all the data obtained from point (1.) but set your DATA to the new file-path of your new image (from point 3.). 5. Insert into the thumbnail mediastore the thumbnails of this new image. Use the data from point (2.), but update the IMAGE_ID with the new image-id from point (4.) and make also copies of each thumbnail file (DATA column). On Feb 17, 9:19 pm, benderillo <[email protected]> wrote: > Hi everybody, > > Here is the problem: > I'm trying to figure out the best way to copy exisitng jpeg image on > SD card from one folder to another with MediaStore database properly > updated. > > First approach I tried: > 1) Open IN and OUT streams; 2) Copy file to a new location as byte > stream; 3) Use MediaScannerConnection.scanFile() to update MediaStore > DB. > This way works fine except one problem: image thumbnail is not > generated (MediaStore.Images.Thumbnails is empty). I looked inside > "scanFile" method; it doesn't seem to have any code for thumbnail > generation. > > Second approach: > Try to use Images.Media.insertImage() - with this approach I don't > know how to chose the physical location of the new file. You can't > control this. You just get an Uri to a copy of the image which is > copied (re-encoded) to some place but not the folder you need it to be > in. > > In other words, my question is: Is there any way to give MediaStore an > image file and say "Please, take this file and fill up your database > with all the information it should have, including thumbnail"? -- 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

