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

Cropping image square #329

Open
piyushlodaliya opened this issue Feb 6, 2019 · 3 comments
Open

Cropping image square #329

piyushlodaliya opened this issue Feb 6, 2019 · 3 comments

Comments

@piyushlodaliya
Copy link

piyushlodaliya commented Feb 6, 2019

  1. Choose a square image and set it to CropViewController with setAspectRatioPreset as square.
  2. I choose a square aspect ratio from the aspect ratio button.
    3. The frame which is generated is not actually square.
    Can I have a solution for these...?
@TimOliver
Copy link
Owner

Hi!

Sounds like a bug! Please attach the image, and paste the code you used to present the view controller.

I don't have time to maintain this right now. All PRs are welcome. :D

@piyushlodaliya
Copy link
Author

func CropViewController(imagePosted : UIImage) {
let image: UIImage = imagePosted
let cropViewController = CropViewController(image: image)
cropViewController.delegate = self
cropViewController.setAspectRatioPreset(.presetSquare, animated: true)
self.navigationController?.pushViewController(cropViewController, animated: false)
}

The image which I had selected is as below:
1474177280368

@AwaisFayyaz
Copy link

I am using this code. i wanted the cropped image to be square only and its working perfectly fine.

cropVC = TOCropViewController.init(image: image)
cropVC.delegate = self
cropVC.setAspectRatioPresent(.presetSquare, animated: true)
cropVC.aspectRatioLockEnabled = true
present(AccountSettingsVC.cropVC, animated: true, completion: nil

Thanks Tim Oliver. Save me a lot of development Time.

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

No branches or pull requests

3 participants