https://github.com/hackersandslackers/gcloud-image-transformer
πΌπ¨ Optimize images hosted on Google Cloud Storage.
https://github.com/hackersandslackers/gcloud-image-transformer
cdn flask google-cloud-storage pillow python3 retina serverless webp
Last synced: 3 months ago
JSON representation
πΌπ¨ Optimize images hosted on Google Cloud Storage.
- Host: GitHub
- URL: https://github.com/hackersandslackers/gcloud-image-transformer
- Owner: hackersandslackers
- Created: 2019-06-28T13:30:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-04-14T16:44:37.000Z (3 months ago)
- Last Synced: 2025-04-28T11:26:55.257Z (3 months ago)
- Topics: cdn, flask, google-cloud-storage, pillow, python3, retina, serverless, webp
- Language: Python
- Homepage:
- Size: 106 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Google Cloud Storage Image Transformer





[](https://github.com/hackersandslackers/gcloud_image_transformer/issues)
[](https://github.com/hackersandslackers/gcloud_image_transformer/stargazers)
[](https://github.com/hackersandslackers/gcloud_image_transformer/network)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:
```shell
$ git clone https://github.com/hackersandslackers/gcloud_image_transformer.git
$ cd gcloud-image-transformer
$ pipenv shell
$ pipenv update
$ python3 main.py
```Installation via [Poetry](https://python-poetry.org/):
```shell
$ git clone https://github.com/hackersandslackers/gcloud_image_transformer.git
$ cd gcloud-image-transformer
$ poetry install
$ poetry run
```Alternatively, try installing via `setup.py`:
```shell
$ 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