Download binary for your environment from latest release, or go get like:
go get -u github.com/syoya/resizer/...
resizer
ENVIRONMENT: development or production. In default productionGOOGLE_AUTH_JSON: The service account JSON of Google Cloud.RESIZER_ACCOUNT: Path to the file of Google service account JSON.RESIZER_BUCKET: Bucket name of Google Cloud Storage to upload the resized image.RESIZER_CONNECTIONS: Max simultaneous connections to be accepted by server. When 0 or less is specified, the number of connections isn't limited.RESIZER_DSN: Data source name of database to store resizing information.RESIZER_HOST: Hosts of the image that is allowed to resize. When this value isn't specified, all hosts are allowed.RESIZER_PORT: Port to be listened.RESIZER_PREFIX: Object prefix of Google Cloud Storage.RESIZER_VERBOSE: Verbose output.curl http://your.host.name/?url=http%3A%2F%2Fexample.com%2Fimage.jpeg&width=800
GET http://your.host.name/
key=value parameters with &.
value should be URL-encoded.urlThe URL of a resizing image. Required.
The host of the URL should be specified with hosts in running option.
width, heightThe size of resized image in pixel. In default 0.
0.0 to both of width and height isn't allowed.width is 0. width is guessed with height and the aspect ratio of the source image .height is 0. height is guessed with width and the aspect ratio of the source image .methodHow to resize. contain or cover. Optional. In default contain.
width or height is 0, specified method is ignored and resizer resizes with contain method.contain, resizer resizes image to fall into the specified size and doesn't clip.cover, resizer resizes image to fill all pixels in the specified size and clips the outer of the specified size.formatThe format of the resized image. jpeg or png or gif. In default jpeg.
qualityThe quality of the resized image as jpeg. 0〜100. In default 100.
format isn't jpeg.2xx.3xx and redirects to the storage URL of that the resized image was saved.Response with the code as 4xx, and the reason will be written in the body.
Content type
Image
Digest
Size
299.3 MB
Last updated
over 4 years ago
docker pull syoya/resizer