当我从图库中获取图像时,出现SELECT_PICTURE错误或从相机拍摄照片。
我的代码是:
-对于照相馆
const Liboptions: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
sourceType:this.camera.PictureSourceType.SAVEDPHOTOALBUM
}
this.camera.getPicture(Liboptions).then((imagePath) => {});
-对于相机
const CamOptions: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
sourceType: this.camera.PictureSourceType.CAMERA
}
this.camera.getPicture(CamOptions).then((imagePath)=>{})
显示错误是:
TypeError: Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordova"]) is not a function. (In 'Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordova"])(this, "getPicture", { "callbackOrder": "reverse" }, arguments)', 'Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordova"])' is an instance of Object)