3 Replies - 193 Views - Last Post: 23 October 2013 - 08:05 AM

#1 Luca91  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 19-August 13

OutOfMemory error while working with Bitmaps

Posted 22 October 2013 - 03:28 PM

Hello mates,
I'm working on an Android application that apply effects(like sepia effect)to photos.
At the moment I managed to get the photo from the camera, to display it on an imageview, and then to apply the effect and save the photo.
The problem is that when I try to apply a filter on a "normal" photo (not a thumbnail) the app crashes while trying to apply the effect due ot an OutOfMemory error. The apps works perfectly with thumbnails tho.

I've read that "normal" hig res photos need to be handled in a certain way to save ram, bu I was not able to understand how..

Can anybody help me ? Thanks

PS: I can post code if needed

Is This A Good Question/Topic? 0
  • +

Replies To: OutOfMemory error while working with Bitmaps

#2 rumbitas  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 98
  • Joined: 07-December 10

Re: OutOfMemory error while working with Bitmaps

Posted 23 October 2013 - 04:33 AM

If you post some code and the logcat, we will try to help you. :rolleyes2:

However, in your manifest file, you can declare the next application clause inside.

android:largeHeap=true


This is only supported from Android 3.0 (ICS).
Was This Post Helpful? 0
  • +
  • -

#3 farrell2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 822
  • View blog
  • Posts: 2,529
  • Joined: 29-July 11

Re: OutOfMemory error while working with Bitmaps

Posted 23 October 2013 - 07:51 AM

You know, different phone support different heap sizes, although most will support 48MB. If your image is just too large to fit on memory, there isn't much you can do about it.
Was This Post Helpful? 0
  • +
  • -

#4 Luca91  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 19-August 13

Re: OutOfMemory error while working with Bitmaps

Posted 23 October 2013 - 08:05 AM

Yes, I figured this out.. I'm trying to use NDK to split the image in some subimages, and to handle them one at the time..
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1