https://github.com/jefer94/gcloud-image-meta
https://github.com/jefer94/gcloud-image-meta
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jefer94/gcloud-image-meta
- Owner: jefer94
- Created: 2023-11-07T06:57:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-07T06:57:20.000Z (over 1 year ago)
- Last Synced: 2025-02-17T09:42:49.243Z (3 months ago)
- Language: Go
- Size: 57.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Google Cloud Function for Image Shape Detection
This Google Cloud Function processes an image, calculates its shape and orientation, and saves the metadata in a `.img.meta` file in the same Google Cloud Storage bucket. The function receives an HTTP request containing the filename and the bucket where the image is located. It then performs image processing and metadata storage. The response includes the image's shape, orientation, width, and height.
## Execute locally
```bash
FUNCTION_TARGET=TransferFile LOCAL_ONLY=true go run cmd/main.go
```## Requirements
- Google Cloud Storage
- [Google Cloud Storage Client Library for Go](https://pkg.go.dev/cloud.google.com/go/storage)
- [MessagePack Library for Go](https://pkg.go.dev/github.com/vmihailenco/msgpack)
- [Imaging Library for Go](https://pkg.go.dev/github.com/disintegration/imaging)## Setup
1. Set up your Google Cloud Project and enable Google Cloud Functions.
2. Deploy this function using `gcloud`:
```shell
gcloud functions deploy ImageMeta \
--runtime go121 \
--trigger-http \
--allow-unauthenticated