NodeImageResizer
Node Image Resizer with Sharp. If you find any bug feel free to open a new issue. (This is my first node project so I'm sorry if you don't like it :p)
Example url: http://nodeimageresizer.herokuapp.com/?url=https://www.nasa.gov/sites/default/files/thumbnails/image/pia22228.jpg&width=386&height=450&resize=cover
How to setup
- Make sure you got node and npm installed.
- Clone the repo
- Run
npm i
- Run
node index.js
- Enjoy the server ;D
Configuration
key
: The key used to clear the cache.
How to use
Visit {host}:3000/
and there you'll have the image resizer. These are the params:
url
[Required]: the original image urlwidth
[Optional]: the new widthheight
[Optional]: the new heightresize
[Optional]: the resize format. It can becover
,fill
,contain
,inside
oroutside
. (Click here for more information)gravity
[Optional]: the gravity format. It can benorth
,northeast
,east
,southeast
,south
,southwest
,west
,northwest
,center
orcentre
. (Click here for more information)format
[Optional]: the format of the image. It can bepng
,jpg
,jpeg
,gif
,webp
ortiff
.
Argument | Required | Type | Default | Max Size |
---|---|---|---|---|
url | yes | URL | - | 200 |
width | no | Integer | - | 4000 |
height | no | Integer | - | 4000 |
format | no | String | png | - |
resize | no | String | cover | - |
gravity | no | String | center | - |