Skip to main content
Participant
August 4, 2012
Question

AIR IOS app crashes on Base64 encoding image

  • August 4, 2012
  • 2 replies
  • 2981 views

In my app people can take a picture to send it to an API.

The image is loaded with a mediapromise and displayed in the view.

When the user submit his form I take following steps

  • Resize the Bitmap to 800 width (tried lower reasonable sizes wothout success)
  • encode it to a byteArray with the blooddy crypto jpegencoder with a quality of 70
  • (I also tried to compress the bytearray)
  • encoded the bytearray to a Base64 string (think I used all available base64 libs)
  • send to the API.

This process runs smooth and fast enough on my HTC Desire but on any IOS device I test (iPhone,S3,iPhone 4) the app crashes or freezes the moment the Base64 encoder starts.

I guess this has something to do with a memory limit?

Does anyone know how I could prevent the crash?

Is it possible to Asynchronous Base64 encode an image?

Could it be a solution to create an ANE for the base64 encoding?

This topic has been closed for replies.

2 replies

Participating Frequently
December 23, 2012

True, bloody encoder is crashed on iOS. There are a lot of other asynchronous encoder for you to try. I did dig Google and try so many of them, they all works, but sadly they still leak ur device's memory a lot It's almost frozen when the encoder run, take over 30 seconds on my iPad 3... sometime crash the app on iPhone 3GS.. do anyone know which one can encode images the best on iOS?

Colin Holgate
Inspiring
December 23, 2012

There are two main encoders from Adobe, the old one that Mike Chambers did, which will take 20-30 seconds even on a computer, and there is the native one that was added with Flash Player 11.3. If you can use that version, or if you're using AIR 3.3 or later, then the native encoder is incredibly fast.

Participating Frequently
December 23, 2012

May I ask for a class name or references? So I can give it a try. Thank you, Colin.

Inspiring
October 5, 2012

Try a different jpeg encoder, the bloody one is known to have issues on ios