Convert image to target type. ex: heic to jpg
Easy to use as micro service in a system
- docker
- docker
- golang
- imagemagick
The following is apply to local development or test
- Build the image
cd <path-of-repo>
docker build -t image-converter ./
- Start the image
docker run -p 80:80 -d -t image-converter
-
Open Postman or other tools can send
POST
method withform-data
-
Pass the params to endpoint
/image
POST /image
form-data:
image: <the file you pick>
type: <the target type you want. ex: jpg>
- Done! Receive the image return from the container
If using Postman, the image will directly display in the response body
- Compress the image if too large
- Response image's url by keeping the image in the container
- Allow pdf to jpg