Images are rendering extremely slow in my Ionic app when uploading or downloading from Firebase. Is there an easy solution for this?
selectPhoto(photoName: string): void {
this.camera.getPicture({
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
destinationType: this.camera.DestinationType.DATA_URL,
quality: 100,
encodingType: this.camera.EncodingType.PNG,
}).then(imageData => {
this.myPhoto = imageData;
this.uploadPhoto(photoName);
}, error => {
console.log("ERROR -> " + JSON.stringify(error));
});
}
private uploadPhoto(photoName: string): void {
this.myPhotosRef.child(photoName)
.putString(this.myPhoto, 'base64', { contentType: 'image/png' })
.then((savedPicture) => {
this.myPhotoURL = savedPicture.downloadURL;
this.changeFromButtonToPic(photoName);
});
}