Reputation: 41
I am new in this field. I need to upload one image and resize it (small(h:100,w:100), medium(h:200,w:200), (large(h:300,w:300)) and store this three different sized images to firebase storage.
My code: It uploads one image and store it to firebase storage. No more!!!
Above html form with input file and button onclick=uploadimage()
Can you help me please!!!
Upvotes: 0
Views: 1242
Reputation: 83048
You can use the Firebase extension dedicated to images resize: https://firebase.google.com/products/extensions/storage-resize-images
Use this extension to create resized versions of an image uploaded to a Cloud Storage bucket.
When you upload an image file to your specified Cloud Storage bucket, this extension:
- Creates a resized image with your specified dimensions.
- Names the resized image using the same name as the original uploaded image, but suffixed with your specified width and height.
- Stores the resized image in the same Storage bucket as the original uploaded image.
You can even configure the extension to create resized images of different dimensions for each original image upload. For example, you might want images that are 200x200, 400x400, and 680x680 - this extension can create these three resized images then store them in your bucket.
Upvotes: 2