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

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.1-dev
    • Component/s: cordova-plugin-camera
    • Labels:
      None
    • Environment:

      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

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

              Dates

              • Created:
                Updated:
                Resolved: