android-crop icon indicating copy to clipboard operation
android-crop copied to clipboard

OutOfMemoryError decodeRegion

Open btcrecover opened this issue 10 years ago • 4 comments

croppedImage = decoder.decodeRegion(rect, new BitmapFactory.Options());

OutOfMemoryError Exception

btcrecover avatar Jul 21 '14 09:07 btcrecover

Try these:

sampleSize = calculateBitmapSampleSize(sourceUri);
is = getContentResolver().openInputStream(sourceUri);
BitmapFactory.Options option = new BitmapFactory.Options();
option.inSampleSize = sampleSize;
croppedImage = decoder.decodeRegion(rect, option);

IlyaEremin avatar Dec 01 '14 19:12 IlyaEremin

java.lang.OutOfMemoryError at android.graphics.BitmapRegionDecoder.nativeDecodeRegion(Native Method) at android.graphics.BitmapRegionDecoder.decodeRegion(BitmapRegionDecoder.java:373) at com.soundcloud.android.crop.CropImageActivity.decodeRegionCrop(CropImageActivity.java:353) at com.soundcloud.android.crop.CropImageActivity.onSaveClicked(CropImageActivity.java:295) at com.soundcloud.android.crop.CropImageActivity.access$000(CropImageActivity.java:45) at com.soundcloud.android.crop.CropImageActivity$3.onClick(CropImageActivity.java:106) at android.view.View.performClick(View.java:4475) at android.view.View$PerformClick.run(View.java:18786) at android.os.Handler.handleCallback(Handler.java:730) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:5419) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) at dalvik.system.NativeStart.main(Native Method)

Using a Galaxy SIII with 1GB Ram.

TiagoGouvea avatar Feb 22 '15 21:02 TiagoGouvea

Same here, up up!

claucookie avatar Feb 26 '15 10:02 claucookie

same here, how to do?

shenhuniurou avatar May 06 '16 09:05 shenhuniurou