Skip to content Skip to sidebar Skip to footer

How To Save Image Path In Sqlite Cordova

I want show the image taken from camera or chosen from gallery , after saving the image in filesystem then pushing the file image url into sqlite database successfully , I can't fi

Solution 1:

you can preview your image by setting destinationType to Camera.DestinationType.DATA_URL

varoptions= {
            quality:75,
            destinationType:Camera.DestinationType.DATA_URL,
            sourceType:sourceType,
            allowEdit:true,
            encodingType:Camera.EncodingType.JPEG,
            correctOrientation:true,
            targetWidth:800,
            targetHeight:800,
            popoverOptions:CameraPopoverOptions, //forIOSandIPADsaveToPhotoAlbum:false
        };

and in callback, use

"data:image/jpeg;base64," +imageData;

like this

$cordovaCamera.getPicture(options).then(function(imagePath) {

     var currentImage = "data:image/jpeg;base64," +imagePath;

});

Post a Comment for "How To Save Image Path In Sqlite Cordova"