Docker based service for uploading and transforming images on the fly ๐ฆ. Based on native, ultra fast Sharp and Amazon S3.
- ๐ฅ๏ธ Transform images on the fly Upload image and apply transformation by adding them to the url. Similar to Cloudinary.
- ๐ Resize, Crop, Face detection and other image transformations. Based on Sharp
- ๐ Amazon S3 as file storage we store original uploads and all transformations over to your S3 bucket.
- ๐ค Upload directly from client app. .
- ๏ธโก๏ธ Easy to use Img Fly is a Node.JS based microservice, shipped in Docker container.
- ๐ฐ Automated S3 storage cleanup. We cleanup your S3 bucket if file isn't accessed for over 30 days. ImgFly saves your money. (planned)
- ๐ฎโโ๏ธ Secure โ we keep all uploads and file access secure by verifying
md5(resourceId,imgFlySecretKey)
. (planned)
- Clone this repo
- Create
.env
file with Amazon s3 credentials (see .env.example). - Start a project using
./bin/start.sh
. - Navigate to the
http://localhost:3002/
and upload image file. - Click on the transformation link and play around with url params.
Extract + Resize example:
http://localhost:3001/5ac0bb5fab7ce4028e879d03/extract-left_0,top_30,width_400,height_300+resize-width_300/nice_file_name.png
ImgFly shipped as Docker container. If you already using docker-compose for your project it won't take more than 5 minutes to install and start using ImgFly.
You'll need to add following to your docker-compose file. Full installation and usage guide
img-fly:
image: paralect/img-fly:v0.2.2
ports:
- "3003:3001"
environment:
NODE_ENV: "production"
IMG_FLY_AWS_SECRET_KEY: "YOUR AWS SECRET"
IMG_FLY_AWS_ACCESS_KEY: "YOUR AWS ACCESS KEY"
IMG_FLY_AWS_S3_REGION: "YOUR AWS REGION"
IMG_FLY_AWS_S3_BUCKET: "YOUR BUCKET NAME"
IMG_FLY_MONGO_CONNECTION: "mongodb://mongo:27017/img-fly-dev"
IMG_FLY_MONGO_COLLECTION: "img-fly_files"
IMG_FLY_API_URL: "http://localhost:3003"
IMG_FLY_DEBUG: "true"
Feel free to submit PR's with more transformations. You'll need to implement a function which maps query params to the sharp function params.
We use following rules to form query params.
+
is used to combine multiple transformations.-
is used as separator between transformation name and params._
is used to separate param name and param value;
Example of applying extract & resize transformations: extract-left_0,top_30,width_400,height_300+resize-width_300
Example of resize and crop: resize-width_300,height_300+crop-strategy_attention
N/A
This project adheres to Semantic Versioning. Every release is documented on the Github Releases page.
Ship is released under the MIT License.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Thanks goes to these wonderful people (emoji key):
Evgeny Zhivitsa ๐ป ๐ ๐ค ๐ |
Ihar ๐ป ๐ ๐ค ๐ |
Andrew Orsich ๐ป ๐ ๐ค |
---|
This project follows the all-contributors specification. Contributions of any kind welcome!