Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize an image before uploading it to firebase

Firebase storage looks very cool and easy to use, but I'm wondering if there's a way to resize an image before uploading it to Firebase Storage, e.g., run a proccess using ImageMagick in a server and then run the uploading process using Firebase SDK but I notice there aren't storage functions for Firebase SDK Server.

like image 732
Sergio Flores Avatar asked May 31 '16 23:05

Sergio Flores


People also ask

Does Firebase compress images?

Automatic image optimization for images in Firebase storageIt also compresses the image using the quality optimization setting in your ImageKit dashboard. With these automatic optimizations, you can be assured that ImageKit will deliver the right image on every device.

Can I use Firebase Storage without authentication?

No Firebase Authentication…To use the Firebase Storage we need to authenticate a user via Firebase authentication. The default security rules require users to be authenticated. Firebase Storage is basically a powerful and simple object storage, in which you can store your files easily.


1 Answers

You can also use Firebase Storage + Google Cloud Functions to upload an image, resize the image (using ImageMagick or similar), and write it back to Firebase Storage.

I have an example using these together here (though I trigger the Cloud Vision API, rather than an image resizer).

A quick side note: Firebase Storage doesn't have a Node.js client, instead we recommend using the GCloud-Node library.

like image 123
Mike McDonald Avatar answered Oct 07 '22 21:10

Mike McDonald