Image resizing using Google Cloud Storage and Cloud Functions
Google Storage is extensively used to store static images to be served by different platforms. One of the needs of the modern-day digital world is to have images created for different form factors—desktop, mobile and tablet screens. In this recipe, we'll develop a Cloud Function to resize the images uploaded to a bucket:
Getting ready
The following are the initial setup verification steps to be carried out before the recipe can be executed:
- Create or select a GCP project
- Enable billing and enable the default APIs (some APIs such as BigQuery, storage, monitoring, and a few others are enabled automatically)
- Verify that Node.js and Google Cloud SDK are installed
- Verify that the Google Cloud Functions API is enabled
How to do it...
The steps involved are as follows:
- Navigate to the
Chapter17/imageresize
folder. - The
package.json
file contains the necessary models for our Node.js Cloud Function. - The
config.json
file contains the dimensions for...