Sign inSign up

k14n/samurai-crop-server

By k14n

•Updated over 11 years ago

Image
0

952

k14n/samurai-crop-server repository overview

⁠samurai-crop-server

Server for uploading, cropping and rotating images.

⁠Uploading images

Go to http://localhost:4567/uploadForm⁠ to upload a file.

⁠Cropping images

Parameters:

NameDescriptionRange
cwwidth of crop rectangle relative to image width0.0 - 1.0
chheight of crop rectangle relative to image height0.0 - 1.0
dxtranslate center of crop rectangle horizontaly relative to centre of image-0.5 - 0.5
dysame as dx, only in vertical direction-0.5 - 0.5
arotation of crop rectangle+/- 45 degrees
curl http://docker:4567/crop/image1.jpg/407x408?cw=1.00&ch=0.99&dx=0.5&dy=123&a=0.2

⁠In container persistence

docker run -d -p 4567:4567 --name samurai k14n/samurai-crop-server

⁠Amazon s3

docker run -d -p 4567:4567 --name samurai --env-file=dockerenv.txt  k14n/samurai-crop-server

Environment variables (dockerenv.txt:

S3-ACCESS-KEY=xxxxxxxxxxx
S3-SECRET-KEY=xxxxxxxxxxx
S3-HOST=
S3-BUCKET=mybucket

Use your favorite editor to enter your own environment values.

⁠Build

docker build -t k14n/samurai-crop-server .

⁠Develop

$ git clone https://github.com/kristianhelgesen/samurai-crop-server.git
$ cd samurai-crop-server
$ docker run -it -p 4567:4567 --name samurai -$(pwd):/app  k14n/samurai-crop-server
/app # ruby samurai-crop-server.rb

Tag summary

Content type

Image

Digest

sha256:a4a488200…

Size

29.8 MB

Last updated

over 11 years ago

docker pull k14n/samurai-crop-server