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.
I attempt to extract a Bitmap via
android.provider.MediaStore.Images.Media.getBitmap() static member
function.
My code is (essentially)
// given long id which is the "_id" of an Image held in the
// Images ContentProvider
import android.provider.MediaStore.Images.Media;
import android.content.ContentUris;
<SNIP...>
<SNIP>
String TAG="MyClass";
Uri externalContentUri = Media.EXTERNAL_CONTENT_URI ;
Uri imageUri = ContentUris.withAppendedId(externalContentUri, id);
try {
// Get a ContentResolver
ContentResolver cr = getContentResolver();
// Get a Bitmap
Bitmap bp=Media.getBitmap(cr, imageUri);
}
catch (Throwable t) {
Log.e(TAG, "Exception " + t.getMessage() );
}
In the DDMS Log I get an Error Message
Exception bitmap size exceeds VM budget.
Is there a way to avoisd this ? Can I simultaneously compress and
extract the image data (say to a JPEG format) ?
thanks
Graeme
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---