Open Disoc opened 5 years ago
const options: ImagePickerOptions = { maximumImagesCount: 1, // width: 300, height: 350, quality: 90, outputType: 1 };
this.imagePicker.getPictures(options).then((results) => { if (results) { if (type == 'top') { for (var i = 0; i < results.length; i++) { this.imageUrl = 'data:image/jpg;base64,' + results[i]; this.frontImg = results[i]; console.log('Image URI: ' + results[i]); } } else { for (var j = 0; j < results.length; j++) { this.imageUrlBack = 'data:image/jpg;base64,' + results[j]; this.backImg = results[j]; } } } this.nativeService.hideLoading(); }, (err) => { this.nativeService.hideLoading(); alert(err); });
After selecting the photo, the returned base64 string is incomplete,However, I set the height below 200, and the returned base64 string is complete, but the picture is too blurry
this.imagePicker.getPictures(options).then((results) => { if (results) { if (type == 'top') { for (var i = 0; i < results.length; i++) { this.imageUrl = 'data:image/jpg;base64,' + results[i]; this.frontImg = results[i]; console.log('Image URI: ' + results[i]); } } else { for (var j = 0; j < results.length; j++) { this.imageUrlBack = 'data:image/jpg;base64,' + results[j]; this.backImg = results[j]; } } } this.nativeService.hideLoading(); }, (err) => { this.nativeService.hideLoading(); alert(err); });
After selecting the photo, the returned base64 string is incomplete,However, I set the height below 200, and the returned base64 string is complete, but the picture is too blurry