storage-resize-images add compression option
[READ] Step 1: Are you in the right place?
Issues filed here should be about a feature request for a specific extension in this repository. To file a feature request that affects multiple extensions or the Firebase Extensions platform, please reach out to Firebase support directly.
[REQUIRED] Step 2: Extension name
This feature request is for extension: _ (storage-resize-images)
What feature would you like to see?
Describe the feature you would like to add, or how you'd like to see the extension change.
Suggested by @apascal07, we should allow the user to specify that the file should be compressed / lower quality. (Sample docs of how to configure that in sharp here: https://stackoverflow.com/questions/51291678/compress-image-using-sharp-in-node-js)
How would you use it?
Tell us how you'd use this feature in your app.
HI @huangjeff5,
I think this feature might be already existed by specifying the OUTPUT_OPTIONS param. For example:
{"png":{"compressionLevel":9}}
https://sharp.pixelplumbing.com/api-output#parameters-6
Can you please confirm if this serves your needs?
@yamankatby You are referencing sharps documentation on this. Does this mean that sharps compression options params also apply to this extension?
I was only able to find this example in the extension page.
{"jpeg": { "quality": 5, "chromaSubsampling": "4:4:4" }, "png": { "pallete": true }}
Do you know where I can find the full api for this? This would be incredible if this extension supported lossly compression.
@Jonathan002 Reviewing the extension, we pass these options directly to sharp, so I think you can indeed pass on compression options within the OUTPUT_OPTIONS param, under the extension (e.g under the key png)
I think the only action here would be to update documentation to reflect this