I'm building a website which will have a lot of user uploaded images. I would like to resize and compress (preferably change their format to .jpg) these images client side, before uploading them to a server.
How would one go about doing this? I have found a few solutions, but none that really work on uploaded files. The latest I've tried is the Hermite-resize script. Should be as simple as:
// Get images from input field
var uploadedImages = event.currentTarget.files;
var HERMITE = new Hermite_class();
HERMITE.resize_image(uploadedImages[1], 300, 100);
But apparently the uploadedImages
return as null
. While I'm also using them elsewhere, so I'm 100% positive they are not null
Does anyone know how to use this script effectively with uploaded files?
Or is there, perhaps, a better solution to resize/compress images on the client side?
Thanks in advance!