peterver / vanilla-image-cropper

A lightweight vanilla js image cropper, with zero dependency requirements
MIT License
55 stars 10 forks source link

Is there a way to set a fixed aspect ratio to the cropper? 🤔 #18

Open sntlln93 opened 3 years ago

sntlln93 commented 3 years ago

The cropper's outline its allways square unless the fixed option is set to false. I want to set the cropper to a fixed aspect ratio, can i do that? If not, im willing to make a PR, just need to someone point me in the right direction regarding what files should i take a look.

peterver commented 2 years ago

@sntlln93 Thanks for your question!

At the moment this is not possible, I built this library for a couple of small usecases a while ago. However, I will most likely do some work on it in the coming weeks to introduce some much-needed improvements (such as usage of css variables for theming, more modern build approach, additional configuration options, etc).

I'll be noting this one down to take in as an improvement.

Is there a format you would suggest for the ratio configuration (eg: '16:9')?