Introduction
This sample automatically generates thumbnails for images that are uploaded to Cloud Storage.
This quickstart demonstrates using Firebase SDK for Cloud Functions setup with a Cloud Storage trigger.
This sample automatically generates thumbnails for images that are uploaded to Cloud Storage.
See file functions/index.js for the thumbnail generation code.
The thumbnail generation is performed using sharp.
The dependencies are listed in functions/package.json.
The function triggers on upload of any file to your Firebase project's default Cloud Storage bucket.
To deploy and test the sample:
git clone https://github.com/firebase/functions-samples
cd functions-samples/quickstarts/thumbnails
firebase use --add
and select your Firebase projectfirebase deploy
thumb_
prefix will be created in the same folder (make sure you refresh the UI to see the new file).We'd love that you contribute to the project. Before doing so please read our Contributor guide.
© Google, 2016. Licensed under an Apache-2 license.