A Spring web application for resizing images
JAVA_HOME=/path/to/java/java-15-openjdk ./mvnw spring-boot:run
to resize a Base64 encoded image, make a POST call to /resize with base64
and scale as body param.
curl --request POST \
--url https://java-img-resize.herokuapp.com/resize \
--header 'content-type: application/json' \
--data '{
"scale": 0.1,
"base64": ".... base64 string here ....."
}'
the
scaleparam determines whether to scale up or down the image dimensions.scale<1will reduce the size, andscale>1will increase the size.scalemust be greater than 0.
to resize an image available at a remote location:
curl --request POST \
--url https://java-img-resize.herokuapp.com/resize \
--header 'content-type: application/json' \
--data '{
"scale": 0.1,
"url": "image url here"
}'