Skip to content

πŸ–ΌπŸ”¨ Optimize images hosted on Google Cloud Storage.

Notifications You must be signed in to change notification settings

hackersandslackers/gcloud-image-transformer

Repository files navigation

Google Cloud Storage Image Transformer

Python Pillow Requests Google Cloud Functions GitHub Last Commit GitHub Issues GitHub Stars GitHub Forks

Turn any Google Storage Bucket into a CDN for auto-optimized images. GCP Image Transformer ensures that any image added to a GCP bucket has retina, standard definition, webp, and other variants.

Getting Started

Installation with Pipenv:

$ git clone https://github.com/hackersandslackers/gcloud_image_transformer.git
$ cd gcloud-image-transformer
$ pipenv shell
$ pipenv update
$ python3 main.py

Installation via Poetry:

$ git clone https://github.com/hackersandslackers/gcloud_image_transformer.git
$ cd gcloud-image-transformer
$ poetry install
$ poetry run

Alternatively, try installing via setup.py:

$ git clone https://github.com/hackersandslackers/gcloud_image_transformer.git
$ cd gcloud-image-transformer
$ python3 setup.py run

The following environment variables are required to run this script:

  • GCP_BUCKET_URL: Publicly accessible URL of gcloud bucket.
  • GCP_BUCKET_NAME: Friendly name of bucket.
  • GOOGLE_APPLICATION_CREDENTIALS: /path/to/service_key.json
  • GCP_BUCKET_FOLDER_NAME (optional): /path/to/images

Releases

No releases published

Packages

No packages published

Languages