I stored my images upload from the user's computer by using Firebase and to improve the performance, I need to compress images in client side (using react) before sending it to Firebase. I found a library to process images called image-compressor. However, I have a problem that, images after compressing by this library cannot be uploaded to Firebase. Here is my code:
const images = await FirebaseSevice.uploadMissionImage(image files);
const IC = new ImageCompressor();
let processed = [];
for (let image of imageFiles) {
IC.compress(image)
.then((result) => {
console.log(result);
processed.push(result);
});
}
const images = await FirebaseSevice.uploadMissionImage(processed);
FirebaseSevice.uploadMissionImage() takes an array of file as parameter.
Can you give me some solution for this case? Thanks a lot!No responses yet.