pqina / filepond

🌊 A flexible and fun JavaScript file upload library
https://pqina.nl/filepond
MIT License
15.2k stars 829 forks source link

FilePond Aspect Ratios For Type of Image #255

Closed danielxu7 closed 5 years ago

danielxu7 commented 5 years ago

Hi,

Currently we have imageCropAspectRatio property which sets the image to said ratio and if using Doka image editor it will also default to the ratio. I was wondering if it was possible to set individual ratios depending on whether an image is portrait or landscape, ie 3:2 ratio if it is landscape and 2:3 (or no set ratio) if it is portrait. Thanks!

rikschennink commented 5 years ago

Hi, This is currently not possible, but it sounds interesting, what is the specific use case if I may ask? As in, why set a different crop ratio depending on image orientation? And, what would happen if the added image is a square?

danielxu7 commented 5 years ago

The images we are uploading are pictures of housing properties for our clients. Our aspect ratio has always been 3:2 so for portrait images we don't cut out anything and just add enough whitespace padding on both sides of the image to make it 3:2. If the image is a square we also add padding. We've decided to strictly enforce 3:2 ratio even on portrait images after switching to FilePond in the meantime but perhaps it could be a niche setting for others later on.

rikschennink commented 5 years ago

Thanks for the additional info. Padding the crop (adding whitespace) is on the roadmap so should become available somewhere in the future.

rikschennink commented 5 years ago

Will close this as "padding the crop" or "letterbox cropping" is on the Doka roadmap.