SmartToolFactory / Compose-Cropper

🚀🏞✂️ Image cropper that can crop with static, dynamic crop behavior, can use customizable shapes, vectors, and other png files as mask to crop with various customizations
MIT License
366 stars 54 forks source link

Different crop shape from the overlay cutout #9

Closed saied89 closed 1 year ago

saied89 commented 1 year ago

Currently there isn't a way to have different crop shape than the overlay cutout. The use case would be when the overlay cutout represents the way the data is presented in the application rather than the way we actually want to crop the image.

I have read the code a bit and seems like a simple fix would be to provide a way to override the crop behaviour i.e a lambda in the api that receives the actually crop args and expects an ImageBitmap with default value equal to the current cropAgent.crop call.

Alternatively we can change the onCropStart to have this functionality.

What do you think?

If you approve the general approach I can do a PR and there we could iron out the details.

SmartToolFactory commented 1 year ago

Hey. Sure you can contribute it. But i didn't understand

Currently there isn't a way to have different crop shape than the overlay cutout.

You can select other shapes as wall. CropAgent checks crop type. Would you mind giving me an example how it doesn't work?