jdamcd / android-crop

Android library project for cropping images
4.54k stars 1.08k forks source link

OutOfMemoryError #233

Closed Mellon closed 8 years ago

Mellon commented 8 years ago

OOM cropping image: Failed to allocate a 35640912 byte allocation with 16775424 free bytes and 26MB until OOM java.lang.OutOfMemoryError: Failed to allocate a 35640912 byte allocation with 16775424 free bytes and 26MB until OOM at dalvik.system.VMRuntime.newNonMovableArray(Native Method) at android.graphics.BitmapRegionDecoder.nativeDecodeRegion(Native Method) at android.graphics.BitmapRegionDecoder.decodeRegion(BitmapRegionDecoder.java:285) at com.soundcloud.android.crop.CropImageActivity.decodeRegionCrop(CropImageActivity.java:346) at com.soundcloud.android.crop.CropImageActivity.onSaveClicked(CropImageActivity.java:290) at com.soundcloud.android.crop.CropImageActivity.access$000(CropImageActivity.java:45) at com.soundcloud.android.crop.CropImageActivity$3.onClick(CropImageActivity.java:114)

Mellon commented 8 years ago

I guess the solution is .withMaxSize(1024, 1024). As I read from the source code.