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

navigator.camera.getPicture ignores quality parameter when width/height are not specified

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.2.1-dev
    • cordova-plugin-camera
    • None
    • iOS

    Description

      When calling navigator.camera.getPicture with default options except for quality, the requested quality is ignored.

      There is a simple work-around, replacing lines 314-315 in CDVCamera.m, :

      // use image unedited as requested , don't resize
      data = UIImageJPEGRepresentation(returnedImage, 1.0);

      with:

      // use image unedited as requested , don't resize (with compression)
      data = UIImageJPEGRepresentation(returnedImage, cameraPicker.quality / 100.0f);

      However, the code hints there may be some (undocumented?) intention to minimize processing in some situations, so this may not be a full fix.

      Attachments

        Activity

          People

            jcesarmobile jcesarmobile
            youval.bronicki@gmail.com Youval Bronicki
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: