qchenqizhi / QCropper

Image cropping/rotating/straightening library for iOS in Swift
MIT License
268 stars 51 forks source link

Flip Doesn’t Work Second time with initialState. #9

Closed fazal-e-majid closed 3 years ago

fazal-e-majid commented 3 years ago

@qchenqizhi Thank you for this beautiful library. I’m facing a bug that when I just flip the image and click done. and then when I come back with initial state and again change just flip, this time it’s not allowing me to click done. Is there no any support for flip in state management ?

qchenqizhi commented 3 years ago

Thank you for your feedback, this is a bug and has been fixed. Update state when flipping

fazal-e-majid commented 3 years ago

@qchenqizhi Thank you for fixing one part of the issue. Although the flip is working good independently but the bug is still there. The reset button has no effect on flip. And there is a case where Done button doesn’t work:

  1. Reset Button is not in sync with flip.
  2. Done button doesn’t work with flip. Possible steps to reproduce are : -> Change only flip. -> Done. -> Next time just click Reset. //( doesn’t resets flip ) => One. -> Done doesn’t work either. // => Two.
qchenqizhi commented 3 years ago

@fazal-e-majid There should be no problem this time. 😅 Reset the flip state when reset

fazal-e-majid commented 3 years ago

@qchenqizhi Thank you for creating this project and giving support ! ❤️

fazal-e-majid commented 3 years ago

@qchenqizhi there’s another case where it’s not working as expected.

-> Apply just flip. -> Cancel. -> Reopen the controller. // Image is already flipped.

qchenqizhi commented 3 years ago

@fazal-e-majid I cannot reproduce this problem, can you elaborate on the details of "Reopen"?

qchenqizhi commented 3 years ago

In addition, the current logic is: After Cancel, this CropperViewControllerneeds to be discarded, so there is no reset work when Cancel. If you need to reopen it, you need to pass a CropperState to the init(originalImage: initialState) method of CropperViewController

fazal-e-majid commented 3 years ago

got you ! @qchenqizhi Thank you very much. ❤️❤️