android-multipicker-library icon indicating copy to clipboard operation
android-multipicker-library copied to clipboard

java.lang.OutOfMemoryError

Open rafaelkogimobile opened this issue 8 years ago • 8 comments

Using a Motorola E2, O.S. v5.0.2, downloading a big file (i.e. a nasa file), then selecting it with the picker, and setting the options

imagePicker.ensureMaxSize(1090, 1090);

It however crashes on line 587 of FileProcessorThread on the method: protected ChosenImage ensureMaxWidthAndHeight(int maxWidth, int maxHeight, ChosenImage image) line: bitmap = BitmapFactory.decodeStream(scaledInputStream, (Rect)null, e); with an outOfMemoryException, is this the expected behaviour?

rafaelkogimobile avatar Apr 22 '16 21:04 rafaelkogimobile

Whats is the size of the image? Will have to check this.

coomar2841 avatar Apr 23 '16 02:04 coomar2841

39.13MB, 19332x20076 http://effigis.com/wp-content/uploads/2015/02/Airbus_Pleiades_50cm_8bit_RGB_Yogyakarta.jpg

rafaelkogimobile avatar Apr 25 '16 20:04 rafaelkogimobile

Wow.. That's a huge image. Will check this out.

coomar2841 avatar Apr 25 '16 20:04 coomar2841

It works on my phone. Probably, 1090x1090 is a bit large image for your device to render. Could you try with a smaller dimension and check?

coomar2841 avatar Apr 26 '16 18:04 coomar2841

@coomar2841 Why don't use inSampleSize to handle it?

zxy198717 avatar May 05 '16 04:05 zxy198717

I could, but the OP wants the image size to be at-least 1090, so inSampleSize won't work here. I haven't yet thought of how to handle such images yet. Planning this for a later release.

coomar2841 avatar May 13 '16 11:05 coomar2841

@coomar2841 I see you removed it from v1.1.0. So when do you plan to enhance it? I found OOM in many devices when render the image which size is same with device's size.

Thanks, Alvin

zxy198717 avatar Jun 07 '16 01:06 zxy198717

I am also getting this crash in huge amount. What should be done to avoid this crash?

vikoo avatar Aug 18 '17 19:08 vikoo