41
Views
1
Comments
[Cropper Library] Automatically cropping on page load
cropper-mobile
Reactive icon
Forge asset by Labs
Application Type
Reactive

I would like to trigger the crop function on page load.

Or even just using a button, is it possible to have a crop button that does the crop?


Right now only direct interaction with the canvas will trigger a crop, I am only trying to enforce a square image, so an instant crop is all that is needed (or a crop on button push).


Thanks for your help,

- Daniel

2022-08-03 04-32-50
Ravi Punjwani

Hi Daniel,

I recommend using some other forge component for such use case. This forge component is best suited when you need user interaction for deciding what area to be cropped.

If you need an automated result, it would be worth looking on other options that can help you do the cropping of images based on some parameters (like percentage, image ratio, size in px etc.). Here's a range of different cropping tools available in Outsystems Forge: https://www.outsystems.com/forge/list?q=crop&t=&o=most-popular&tr=False&oss=False&c=%20&a=&v=&hd=False&tn=&scat=forge

You can even implement a small version of your own web block / client action to do the job. Here's a bit of reference from stackoverflow to achieve this via javascript: https://stackoverflow.com/questions/53810434/crop-the-image-using-javascript

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.