My process involves cropping images to a square shape and drawing them onto a canvas.
if(img.height >= img.width) {
ctx.drawImage(img, 0, 0, 110, 110 * img.height / img.width);
} else {
ctx.drawImage(img, 0 , 0, 110 * img.width / img.height, 110);
}
Once the image is drawn, I then convert it to base64 using canvas.toDataURL();
before sending it to the server via a POST request.
However, I also want to give users the option to rotate the image by 90 degrees prior to conversion and submission.
To see a test setup of my process, click HERE