title: Delphi XE7 Bitmap size to big message on Android
body: <p>When I take a picture on my Android phone my XE7 app crashes and it says Bitmap size to big. But I use code i've used before and it worked fine. It's from the example of embarcadero about taking pictures on android/iOS.</p>
  
  <p>My code below:</p>
  
  <pre><code>procedure TForm1.TakePhotoFromCameraAction1DidFinishTaking(
    Image: TBitmap);
  var
    saveParams:TBitmapCodecSaveParams;
    directory,name:String;
  begin
    image1.Bitmap.Assign(Image);
    saveParams.Quality := 100;
    {$IFDEF ANDROID}
    directory := TPath.GetPicturesPath;
    name := '/RoomId:'+ fRoomId.ToString()+' '+DateTimeToStr(Now)+'.png';
    {$ENDIF}
    {$IFDEF IOS}
    directory := TPath.GetDocumentsPath;
    name := '/RoomId:'+ fRoomId.ToString()+' '+DateTimeToStr(Now)+'.png';
    {$ENDIF}
    Image.SaveToFile(directory+name,@saveParams);
  end;
  </code></pre>
  
  <p><strong>Anyone know why it doesn't work?</strong></p>
  
  <p><strong>UPDATE:</strong>
  I know for sure that the code is correct. I've tested it in a different app. Also tried to debug the action and during debug It kept on repeating TTakePhotoFromCameraAction.CustomTextChanged. Also during debug it did save the picture but it couldn't close the action correctly for some reason. Strange thing is that the code also works for a samsung tablet but not for a sony phone.</p>