turner-anderson / streamlit-cropper

A simple image cropper for Streamlit
MIT License
183 stars 28 forks source link

get crop coordinate #2

Closed Chop1 closed 3 years ago

Chop1 commented 4 years ago

Is it possible to get the crop coordinate rather than the cropped image itself ?

turner-anderson commented 4 years ago

Yeah that shouldn't be hard at all. Let me do a little bit of research to see if it makes more sense semantically to add a "return_type" option to the function, or if it makes more sense to return both the image and the coordinates. I'll try to push something within the next few days.

turner-anderson commented 4 years ago

Alright, just pushed that update. There is now an argument called 'return_type' which if you set equal to 'box' will return a dictionary of the top, left, height, and width of the crop box. You should be able to get it with an upgrade to version 0.1.3.

Let me know if you have any issues.

SibtainRazaJamali commented 3 years ago

excellent work