support cropping or resizing images before uploading to the server #929
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Support cropping or resizing images before uploading to the server
You can do this simply in JS. Here I just ensure an image is never bigger than X and Y. But you can change it to suit your purpose.
Something I tend to do is this. Take out what you do not need of course.
`
processCoverImage() {
const imgFile = 'the file input src value'
const maxWidth = 1280;
const maxHeight = 700;
let ratio = 0;
let width;
let height;
let ctx;
}
`