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.
Installation with Pipenv:
$ git clone https://github.com/hackersandslackers/gcloud_image_transformer.git
$ cd gcloud-image-transformer
$ pipenv shell
$ pipenv update
$ python3 main.pyInstallation via Poetry:
$ git clone https://github.com/hackersandslackers/gcloud_image_transformer.git
$ cd gcloud-image-transformer
$ poetry install
$ poetry runAlternatively, try installing via setup.py:
$ git clone https://github.com/hackersandslackers/gcloud_image_transformer.git
$ cd gcloud-image-transformer
$ python3 setup.py runThe 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.jsonGCP_BUCKET_FOLDER_NAME(optional): /path/to/images