图像大小调整-Javascript
我编写了上传到firebase存储目录的代码。我必须使用Javascript调整所选图像的大小。图像大小应为65x65 这是我的密码:图像大小调整-Javascript,javascript,firebase,firebase-storage,image-resizing,Javascript,Firebase,Firebase Storage,Image Resizing,我编写了上传到firebase存储目录的代码。我必须使用Javascript调整所选图像的大小。图像大小应为65x65 这是我的密码: firebase.auth().onAuthStateChanged(function(user) { if (user) { //Handling Contact Form
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
//Handling Contact Form
var uploader_profilfotograf = document.getElementById('uploader_profilfotograf');
var fileButton_profilfotograf = document.getElementById('fileButton_profilfotograf');
fileButton_profilfotograf.addEventListener('change', function(e){
var file = e.target.files[0];
var storageRef = firebase.storage().ref('profile_images/'+user.uid);
var task = storageRef.put(file);
task.on('state_changed', function progress(snapshot) {
var percentage = (snapshot.bytesTransferred/snapshot.totalBytes)*100;
uploader_profilfotograf.value = percentage;
}, function error(err) {
},function complete() {
});
});
}
});
你尝过这些吗?一种可能性是:在后端进行,即使用云功能。看见