A demo of server-side image cropping with Go and cropper.js.
In this demo, we're using cropper.js to crop the image in the browser and send the crop details to the server to process the final result.
Cropper.js uses the browser's native canvas.toBlob API which means, it will produce a reduced quality image. To mend this, we do the crop work on the server.
- Install web app dependencies.
$ yarn // or npm install
- Build the web app.
$ yarn build // or npm run build
- Run the server.
$ go run main.go
- Go to localhost:3002 and start playing!