profile
viewpoint

Ask questionsSudden Crash on iOS when manipulating images from the camera. [Refer Issue #2285].

I need to take continuous capture in my application. I am using Capture API. My App need to catch Atleast 200 photos per session. But I am not able to do.

  1. Without calling the API to store the images in backend, i can do for 100 to 120 images.
  2. When calling API to store the images, I can take only 30+ images. Then the App is getting crashed.
  3. In Android I can take 300+ images in a session without any crash.
  4. I need the same thing to be happen in IOS too.
  5. I am attaching the file here. This file is created for debugging purpose. It is not from my application. Login.java.zip
codenameone/CodenameOne

Answer questions jsfan3

@mailsenthil77 What exactly do you do when manipulating images? For example, do you use Image.createImage(...) or Image.scaled(...)? I solved iOS crashes when manipulating images simply stopping to use these two APIs. Instead of Image.createImage(...) I use EncodedImage.create(...) and instead of Image.scaled(...) I use ImageIO.save(...) to scale the images. In this way there is an huge difference on RAM: for example, to load 20 photos at 12MP, Image.createImage(...) requires about 1GB of RAM (minimum), while EncodedImage.create(...) requires a lot less (see the Javadoc). Moreover, ImageIO.save(...) has no impact on RAM in compare to Image.scaled(...).

useful!

Related questions

RFE: set a Date before 1970 with a lightweight picker hot 1
Ios build fails due to cocoapods update failure hot 1
Github User Rank List