Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotate only image and not the cropper and vice-versa #85

Closed
zeeshanTeks opened this issue Feb 15, 2021 · 7 comments · Fixed by #86
Closed

Rotate only image and not the cropper and vice-versa #85

zeeshanTeks opened this issue Feb 15, 2021 · 7 comments · Fixed by #86

Comments

@zeeshanTeks
Copy link

Hi @guoyingtao

Is it possible to rotate only the image with a button click? And rotate only the cropper(i.e., the ratio is reversed) with a button click?

@guoyingtao
Copy link
Owner

@zeeshanTeks The current version of Mantis does not support it.
Do you want Mantis support this feature instead of #83
Or do you want both?

@zeeshanTeks
Copy link
Author

@guoyingtao Both would be really helpful. Thanks.

@guoyingtao
Copy link
Owner

guoyingtao commented Feb 21, 2021

@zeeshanTeks I added rotate cropper button in the branch 85_rotate_image_cropper_separately
It is actually altering the cropper ratio not rotating. I put the button into the clockwise rotation test example.
I am not sure if it is what you want.
You can test it in the branch 85_rotate_image_cropper_separately

image

image

@zeeshanTeks
Copy link
Author

@guoyingtao Thank you so much, this works perfectly.

@guoyingtao
Copy link
Owner

@zeeshanTeks I released Mantis 1.4.11 which includes this feature.
You can add the button to alter the cropper by adding .alterCropper90Degree to config.cropToolbarConfig.toolbarButtonOptions

        var config = Mantis.Config()
        config.cropToolbarConfig.toolbarButtonOptions = [.clockwiseRotate, .reset, .ratio, .alterCropper90Degree];

@zeeshanTeks
Copy link
Author

Thanks a lot. You are too good.

@marko8994
Copy link

@guoyingtao, as I see in the version this only gives option to independently rotate image and cropper. Is it possible to make an option to have fixed ratio even after image is rotated.

Example:

  1. We have custom ratio 3:4
  2. We rotate image 90 degrees clockwise
  3. Custom ratio stays 3:4 even after rotation, instead of changing to 4:3 like it doing now

I believe that this can be partly related to issue #87 so if you decide that this can be implemented bear it in mind.
If you need any help, I would be happy to contribute. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants