On Thu, Feb 12, 2009 at 7:11 AM, Graeme <[email protected]> wrote: > > Hi > > I am trying to iterate through all the photo images (produced by ADP1 > camera), held on external SD storage in an ADP1. I want to extract the > binary data for each image file, determine image size in bytes and > send the image data (possibly after compression) over a network > conection. > > My code is generating an exception when I try to generate a Bitmap > based on Photos taken by the ADP1 Camera, stored physically on > External SD Card Storage. It looks like the image size is exhausting > VM for my application. (...) > Is there a way to avoisd this ? Can I simultaneously compress and > extract the image data (say to a JPEG format) ?
The pictures taken by the camera are already in jpeg format. Why would you want to compress them to jpeg again? If you want to send the picture at its original size, just send the original file. If you want a scaled-down version, there are ways to decompress the image directly to a smaller size (see BitmapFactory). You could then recompress this smaller image to a new jpeg before sending it. If you're only running out of memory after processing a few images, you might also want to try calling Bitmap.recycle() when you're done processing each bitmap. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

