You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My use case is the following, users can either pick an image from the Gallery or take an Image with the Camera. I want to constrain the aspect ratio to 1:1 (which I can already do!). The user can select which part of the image should be selected and if wanted, zoom into a specific part. Now comes the important part, when the user uses that images I want to upload it right away to the backend. This would happen right now when pressing the check icon:
I've provided my custom toolbar and I am calling cropState.done(true). Now if the backend decides the picture isn't good enough for any of the reasons (like it's too small, too blurry etc), I want that the user can stay in that same picker and give it another try. As far as I can see this isn't possible. The problem is here:
By setting the crop state to null, the moment the image has been cropped it closes. Would you be open to change the behavior such that you can crop but the user is responsable for tearing the image picker down?
The text was updated successfully, but these errors were encountered:
@vanniktech This seems like a very common use-case and needs to be addressed.
Do you have any suggestions on how the crop api should look like?
Maybe we should add another crop function that accepts a lambda and closes the dialog only if we return true (as valid).
Or maybe we should make the state more exportable so we can save it, and restore it if the backend returns an error. So the same image with the same grid positions will be loaded.
Do you have any suggestions on how the crop api should look like?
Not yet. I'm new in Compose land and haven't gotten enough understanding of how an ideal API would look like.
Or maybe we should make the state more exportable so we can save it, and restore it if the backend returns an error. So the same image with the same grid positions will be loaded.
From gut feeling this feels like the better solution. At least the fact that the state of the image cropping should be preserved and you should not need to start from scratch again.
Where inside of state you have a boolean if the button (done) has been pressed and also a way to obtain the BitMap. And then you can do whatever you want and if you want to close it you could call some function on state.
My use case is the following, users can either pick an image from the Gallery or take an Image with the Camera. I want to constrain the aspect ratio to 1:1 (which I can already do!). The user can select which part of the image should be selected and if wanted, zoom into a specific part. Now comes the important part, when the user uses that images I want to upload it right away to the backend. This would happen right now when pressing the check icon:
I've provided my custom toolbar and I am calling
cropState.done(true)
. Now if the backend decides the picture isn't good enough for any of the reasons (like it's too small, too blurry etc), I want that the user can stay in that same picker and give it another try. As far as I can see this isn't possible. The problem is here:krop/library/core/src/commonMain/kotlin/com/attafitamim/krop/core/crop/ImageCropper.kt
Line 99 in 0c239c9
By setting the crop state to null, the moment the image has been cropped it closes. Would you be open to change the behavior such that you can crop but the user is responsable for tearing the image picker down?
The text was updated successfully, but these errors were encountered: