Cloud Run Image Processing Sample

Try me out

Run on Google Cloud

This sample service applies Cloud Storage-triggered image processing with Cloud Vision API analysis and ImageMagick transformation.

Use it with the Image Processing with Cloud Run tutorial.

For more details on how to work with this sample read the Google Cloud Run Node.js Samples README.

Dependencies

  • express: Web server framework
  • gm: ImageMagick integration library.
  • @google-cloud/storage: Google Cloud Storage client library.
  • @google-cloud/vision: Cloud Vision API client library.

Environment Variables

Cloud Run services can be configured with Environment Variables. Required variables for this sample include:

  • INPUT_BUCKET_NAME: The Cloud Run service will be notified of images uploaded to this Cloud Storage bucket. The service will then retreive and process the image.
  • BLURRED_BUCKET_NAME: The Cloud Run service will write blurred images to this Cloud Storage bucket.

Maintenance Note

cp ../../functions/imagemagick/index.js image.js
sed -i '' 's/functions_imagemagick_setup/run_imageproc_handler_setup/' image.js
sed -i '' 's/functions_imagemagick_analyze/run_imageproc_handler_analyze/' image.js
sed -i '' 's/functions_imagemagick_blur/run_imageproc_handler_blur/' image.js