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

Saving the image with circular crop #474

Closed
Snow-Tech opened this issue Jan 28, 2021 · 4 comments
Closed

Saving the image with circular crop #474

Snow-Tech opened this issue Jan 28, 2021 · 4 comments
Assignees
Labels

Comments

@Snow-Tech
Copy link

Snow-Tech commented Jan 28, 2021

Hi, i'm saving the circula crop image in a server, but I want to know, how can I save the image without the circular shape?
It's possible to remove the circular shape?

@nightbird8n
Copy link

Hi @TimOliver ,
Can I get square image(not circular cropped image) when crop circle(I want to use circle mask to crop, but I want a square cropped image)? Is this possible?

@luke-riu
Copy link

@Snow-Tech
The image is cropped and masked before being rasterised. Checkout the implementation below to make them square going forward.

@nightbird8n
I was able to achieve this by using the nice, bundled extensions with their delegate methods.

 func cropViewController(_ cropViewController: TOCropViewController, didCropImageTo cropRect: CGRect, angle: Int) {
    let squareImg = self.image.croppedImage(withFrame: cropRect, angle: angle, circularClip: false)
  }

@nightbird8n
Copy link

Brilliant answer! Thank you, @luke-riu

@Snow-Tech
Copy link
Author

Thank u, @luke-riu.

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

No branches or pull requests

4 participants