cameraExport.getPicture = function()

in www/Camera.js [128:156]


cameraExport.getPicture = function (successCallback, errorCallback, options) {
    argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
    options = options || {};
    const getValue = argscheck.getValue;

    const quality = getValue(options.quality, 50);
    const destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
    const sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
    const targetWidth = getValue(options.targetWidth, -1);
    const targetHeight = getValue(options.targetHeight, -1);
    const encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
    const mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
    const allowEdit = !!options.allowEdit;
    const correctOrientation = !!options.correctOrientation;
    const saveToPhotoAlbum = !!options.saveToPhotoAlbum;
    const popoverOptions = getValue(options.popoverOptions, null);
    const cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);

    if (allowEdit) {
        console.warn('allowEdit is deprecated. It does not work reliably on all platforms. Utilise a dedicated image editing library instead. allowEdit functionality is scheduled to be removed in a future release.');
    }

    const args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
        mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];

    exec(successCallback, errorCallback, 'Camera', 'takePicture', args);
    // XXX: commented out
    // return new CameraPopoverHandle();
};