Starling has limitations on texture sizes which generally aren’t a problem. However, when using the cameraRoll API and loading in an image from the cameraRoll, sometimes those images are over 2048×2048 which causes Starling to crash. Here’s a solution for how to load them in regardless of size. We basically will load in the bitmap data, if the size is too big, create a clone of the data at a scaled size, then use that new data as the bitmap image. This code is a mix of my own and some I found online (for scaling).

//after you load the image, you call this function
private static function imageLoaded(evt:Event):void
{
  var isPortrait:Boolean;
  var ratio:Number;

  //this is the image you just loaded
  var bitmap:Bitmap = evt.currentTarget.content as Bitmap;

  //check to see if this image is bigger than the starling limit.limit
  if(bitmap.width > 2048 || bitmap.height > 2048)
  {
    //find the new scale ratio based on the starling limit of 2048
    if(bitmap.height > bitmap.width)
    {
    ratio = 2048 / bitmap.height;
    }
    else
    {
    ratio = 2048 / bitmap.width;
    }

  //now create a NEW bitmapData object which is a scaled version of the original bitmap
  var newBitmapData:BitmapData = scaleBitmapData(bitmap.bitmapData, ratio);

  //replace original bitmap so rest of code works as intended
  bitmap = null;
  bitmap = new Bitmap(newBitmapData);
  }
}

  private static function scaleBitmapData(bitmapData:BitmapData, scale:Number):BitmapData 
{
  scale = Math.abs(scale);
  var width:int = (bitmapData.width * scale);
  var height:int = (bitmapData.height * scale);
  var transparent:Boolean = bitmapData.transparent;
  var result:BitmapData = new BitmapData(width, height, transparent);
  var matrix:Matrix = new Matrix();
  matrix.scale(scale, scale);
  result.draw(bitmapData, matrix);
  return result;
}