2

I'm using firebase as a database in my application and I'm storing images to firebase cloud storage.

I only want a particular folder's images to be resized rather than every image I upload can I do that using Firebase Resize Image extension?

Renaud Tarnec
  • 79,263
  • 10
  • 95
  • 121
RHS.Dev
  • 412
  • 6
  • 18

1 Answers1

4

No, at the time of writing, if you install a Firebase "Resize Images" Extension for a specific Storage bucket, all the files uploaded to this bucket will be treated by the extension (weither they are uploaded at the root of the bucket or within "folders" (see Note below).

You can verify that either by configuring an instance of the extension (you cannot configure a "source folder") or by looking at the code of the Cloud Function that underlies the Extension.


On the other hand, note that you can configure the Extension to run for a specific Bucket. So you could separate your files (the ones to be resized and the others) in different buckets. You can create new buckets via the Firebase console (or via the Admin SDK), but you need to be on the Blaze pricing plan (see here).


Note: Actually Google Cloud Storage does not have true "folders", but by using a "/" delimiter character in the file path it will behave similarly to folders. In particular the Firebase console will display the files organised in folders.

Renaud Tarnec
  • 79,263
  • 10
  • 95
  • 121
  • 1
    The plugin has been updated to with parameters for 'included' as well as 'excluded' bucket paths. You can even specify a relative child path for the resized images to be saved. I'm trying to find out if I can have various configurations for various bucket paths.. currently it doesn't seem possible. – theZ3r0CooL Mar 15 '22 at 06:02