src/windows/CameraProxy.js
function (picture) {
        if (options.destinationType === Camera.DestinationType.FILE_URI || options.destinationType === Camera.DestinationType.NATIVE_URI) {
            if (options.targetHeight > 0 && options.targetWidth > 0) {
                resizeImage(successCallback, errorCallback, picture, options.targetWidth, options.targetHeight, options.encodingType);
            } else {
                // CB-11714: check if target content-type is PNG to just rename as *.jpg since camera is captured as JPEG
                if (options.encodingType === Camera.EncodingType.PNG) {
                    picture.name = picture.name.replace(/\.png$/, '.jpg');
                }

                picture.copyAsync(getAppData().localFolder, picture.name, OptUnique).done(function (copiedFile) {
                    successCallback('ms-appdata:///local/' + copiedFile.name);
                }, errorCallback);
            }
        } else {
            if (options.targetHeight > 0 && options.targetWidth > 0) {
                resizeImageBase64(successCallback, errorCallback, picture, options.targetWidth, options.targetHeight);
            } else {
                fileIO.readBufferAsync(picture).done(function (buffer) {
                    var strBase64 = encodeToBase64String(buffer);
                    picture.deleteAsync().done(function () {
                        successCallback(strBase64);
                    }, function (err) {
                        errorCallback(err);
                    });
                }, errorCallback);
            }
        }
    }
function (picture) {
        if (options.destinationType === Camera.DestinationType.FILE_URI || options.destinationType === Camera.DestinationType.NATIVE_URI) {
            if (options.targetHeight > 0 && options.targetWidth > 0) {
                resizeImage(successCallback, errorCallback, picture, options.targetWidth, options.targetHeight, options.encodingType);
            } else {
                // CB-11714: check if target content-type is PNG to just rename as *.jpg since camera is captured as JPEG
                if (options.encodingType === Camera.EncodingType.PNG) {
                    picture.name = picture.name.replace(/\.png$/, '.jpg');
                }

                picture.copyAsync(getAppData().localFolder, picture.name, OptUnique).done(function (copiedFile) {
                    successCallback('ms-appdata:///local/' + copiedFile.name);
                }, errorCallback);
            }
        } else {
            if (options.targetHeight > 0 && options.targetWidth > 0) {
                resizeImageBase64(successCallback, errorCallback, picture, options.targetWidth, options.targetHeight);
            } else {
                fileIO.readBufferAsync(picture).done(function (buffer) {
                    var strBase64 = encodeToBase64String(buffer);
                    picture.deleteAsync().done(function () {
                        successCallback(strBase64);
                    }, function (err) {
                        errorCallback(err);
                    });
                }, errorCallback);
            }
        }
    }
function ( picture ) { if ( options . destinationType === Camera . DestinationType . FILE_URI || options . destinationType === Camera . DestinationType . NATIVE_URI ) { if ( options . targetHeight > 0 && options . targetWidth > 0 ) { resizeImage ( successCallback , errorCallback , picture , options . targetWidth , options . targetHeight , options . encodingType ) ; } else { // CB-11714: check if target content-type is PNG to just rename as *.jpg since camera is captured as JPEG if ( options . encodingType === Camera . EncodingType . PNG ) { picture . name = picture . name . replace ( / \.png$ / , '.jpg' ) ; } picture . copyAsync ( getAppData ( ) . localFolder , picture . name , OptUnique ) . done ( function ( copiedFile ) { successCallback ( 'ms-appdata:///local/' + copiedFile . name ) ; } , errorCallback ) ; } } else { if ( options . targetHeight > 0 && options . targetWidth > 0 ) { resizeImageBase64 ( successCallback , errorCallback , picture , options . targetWidth , options . targetHeight ) ; } else { fileIO . readBufferAsync ( picture ) . done ( function ( buffer ) { var strBase64 = encodeToBase64String ( buffer ) ; picture . deleteAsync ( ) . done ( function ( ) { successCallback ( strBase64 ) ; } , function ( err ) { errorCallback ( err ) ; } ) ; } , errorCallback ) ; } } }
success callback for capture operation
success callback for capture operation