Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-1293

Camera.getPicture crashes when selecting from a Picasa album on Android

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.1.0
    • cordova-android
    • None
    • Crash found with 2.0.0 on Galaxy Nexus running Android 4.0.4

    Description

      When using camera.getPicture with options:

      destinationType: Camera.DestinationType.FILE_URI,
      sourceType: Camera.PictureSourceType.PHOTOLIBRARY

      and selecting a photo from a Picasa-synced album, the application crashes immediately upon trying to return the data.

      Here's our downstream bug with some analysis: https://bugzilla.wikimedia.org/show_bug.cgi?id=39604

      FileUtils.getRealPathFromURI() cannot read the "_data" column from the content provider database, so imagePath and bitmap in CameraLauncher.onActivityResult are null. The crash occurs when trying to run bitmap.recycle().

      I can avoid the crash by adding a guard check for bitmap != null and the content: URI is usable in the app to load the image, but doesn't appear to work with FileTransfer.

      Attachments

        Activity

          People

            macdonst Simon MacDonald
            brion Brion Vibber
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: