Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

Setting cropMode to square doesn't crop the picture #141

Description

@pktrkts

Hi,

I'm trying to use your library so that I can crop pictures that are in the photo library to a square. My code:

self?.picker = UIImagePickerController()
//self?.picker = DZNPhotoPickerController()
self?.picker?.delegate = self
self?.picker?.sourceType = .photoLibrary
//self?.picker.allowsEditing = true
self?.picker?.cropMode = DZNPhotoEditorViewControllerCropMode.square
//self?.picker.cropSize = CGSize(width: 200, height: 200)
self?.present((self?.picker)!, animated: true, completion: nil)

I admit that I haven't tried setting self?.picker to DZNPhotoPickerController(), mainly because I'm not entirely sure which methods I need to override for the delegate. Unless I have to use this class to get the square picture, however, I'm happy with using UIImagePickerController and just cropping the picture. This line self?.picker?.cropMode = DZNPhotoEditorViewControllerCropMode.square does not work as expected and I still get rectangular pictures. How do I change my code so I get square pictures?

Thanks,
Sean

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions