{"id":15067019,"url":"https://github.com/jvk75/uiimagecropper","last_synced_at":"2025-04-10T13:54:15.287Z","repository":{"id":56924907,"uuid":"115655083","full_name":"jvk75/UIImageCropper","owner":"jvk75","description":"Simple Image cropper for UIImagePickerController with customisable aspect ratio. Made purely with Swift!","archived":false,"fork":false,"pushed_at":"2020-03-16T20:00:40.000Z","size":116,"stargazers_count":51,"open_issues_count":6,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-20T12:17:27.274Z","etag":null,"topics":["imagecrop","imagecropper","imagecropperswift","ios","swift","swift4","uiimage","uiimagepickercontroller","uikit"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jvk75.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-28T19:55:27.000Z","updated_at":"2023-12-06T11:43:29.000Z","dependencies_parsed_at":"2022-08-21T06:20:08.450Z","dependency_job_id":null,"html_url":"https://github.com/jvk75/UIImageCropper","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvk75%2FUIImageCropper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvk75%2FUIImageCropper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvk75%2FUIImageCropper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvk75%2FUIImageCropper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jvk75","download_url":"https://codeload.github.com/jvk75/UIImageCropper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248229342,"owners_count":21068878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["imagecrop","imagecropper","imagecropperswift","ios","swift","swift4","uiimage","uiimagepickercontroller","uikit"],"created_at":"2024-09-25T01:15:13.411Z","updated_at":"2025-04-10T13:54:15.269Z","avatar_url":"https://github.com/jvk75.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UIImageCropper\n\nSimple Image cropper for UIImagePickerController with customisable crop aspect ratio. Made purely with Swift 4!\n\nReplaces the iOS \"crop only to square\" functionality. Easy few line setup with delegate method/s.\n\n## Requirements\n\n- iOS10+\n- Xcode 9.2+\n- Swift 4\n\n\n## Install\nUIImageCropper is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n``` ruby\npod 'UIImageCropper'\n```\n\n (or add UIImageCropper folder to your project)\n\n## Usage\n\nImport the pod\n\n``` swift\nimport UIImageCropper\n```\n\nCreate instanses of UIImageCropper and UIImagePickerController *(optional, if cropping existing UIImage)*\n\nUIImageCropper can take  `cropRatio` as parameter.  Default ratio is 1 (square).\n\n``` swift\nlet picker = UIImagePickerController()\nlet cropper = UIImageCropper(cropRatio: 2/3)\n```\n\nSetup UIImageCropper\n\n``` swift\ncropper.picker = picker\ncropper.delegate = self\n//cropper.cropRatio = 2/3 //(can be set with variable, before cropper is presented, or in cropper init)\n//cropper.cropButtonText = \"Crop\" // button labes can be localised/changed\n//cropper.cancelButtonText = \"Cancel\"\n\n```\n\nIf just cropping existing UIImage there is no need to set up picker, delegate is enough.\nJust give image to croppen and present it.\n\n``` swift\ncropper.picker = nil // Make sure not set the picker when doing existing image cropping\ncropper.image = UIImage(named: \"image\")\nviewController.present(cropper, animated: true, completion: nil)\n```\n\nFor both cases implement `UIImageCropperProtocol` delegate method/s\n\n``` swift\nfunc didCropImage(originalImage: UIImage?, croppedImage: UIImage?) {\n    imageView.image = croppedImage\n}\n\n//optional (if not implemented cropper will close itself and picker)\nfunc didCancel() {\n    picker.dismiss(animated: true, completion: nil)\n}\n\n```\n\nThe UIImageCropper will handle the image picking (delegate methods). To start image picking just present the UIImagePickerController instance.\n\n``` swift\nself.present(self.picker, animated: true, completion: nil)\n```\n\nFor full usage exmaple see **CropperExample** in Example folder.\n\n## Issues and contribution\n\nIf you find any issues please add and issue to this repository.\n\nImprovements and/or fixes as pull requests are more than welcome.\n\n## Author\n\nJari Kalinainen, jari(a)klubitii.com\n\n## License\n\nUIImageCropper is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvk75%2Fuiimagecropper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjvk75%2Fuiimagecropper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvk75%2Fuiimagecropper/lists"}