{"id":18270439,"url":"https://github.com/kishikawakatsumi/PEPhotoCropEditor","last_synced_at":"2025-04-05T01:30:41.931Z","repository":{"id":8571041,"uuid":"10199731","full_name":"kishikawakatsumi/PEPhotoCropEditor","owner":"kishikawakatsumi","description":"Image cropping library for iOS.","archived":false,"fork":false,"pushed_at":"2022-10-10T10:26:49.000Z","size":62870,"stargazers_count":1086,"open_issues_count":53,"forks_count":357,"subscribers_count":55,"default_branch":"master","last_synced_at":"2025-03-31T10:37:34.144Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/kishikawakatsumi.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":"2013-05-21T15:59:54.000Z","updated_at":"2025-01-01T22:34:52.000Z","dependencies_parsed_at":"2022-08-29T22:52:12.606Z","dependency_job_id":null,"html_url":"https://github.com/kishikawakatsumi/PEPhotoCropEditor","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kishikawakatsumi%2FPEPhotoCropEditor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kishikawakatsumi%2FPEPhotoCropEditor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kishikawakatsumi%2FPEPhotoCropEditor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kishikawakatsumi%2FPEPhotoCropEditor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kishikawakatsumi","download_url":"https://codeload.github.com/kishikawakatsumi/PEPhotoCropEditor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276022,"owners_count":20912285,"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":[],"created_at":"2024-11-05T11:38:38.157Z","updated_at":"2025-04-05T01:30:36.912Z","avatar_url":"https://github.com/kishikawakatsumi.png","language":"Objective-C","funding_links":[],"categories":["etc"],"sub_categories":[],"readme":"PEPhotoCropEditor ![License MIT](https://go-shields.herokuapp.com/license-MIT-yellow.png) \n=================\n\n[![Version](https://cocoapod-badges.herokuapp.com/v/PEPhotoCropEditor/badge.png)](https://cocoapod-badges.herokuapp.com/v/PEPhotoCropEditor/badge.png)\n[![Platform](https://cocoapod-badges.herokuapp.com/p/PEPhotoCropEditor/badge.png)](https://cocoapod-badges.herokuapp.com/p/PEPhotoCropEditor/badge.png)\n[![Build Status](https://travis-ci.org/kishikawakatsumi/PEPhotoCropEditor.png?branch=master)](https://travis-ci.org/kishikawakatsumi/PEPhotoCropEditor)\n[![Analytics](https://ga-beacon.appspot.com/UA-4291014-9/PEPhotoCropEditor/README.md)](https://github.com/igrigorik/ga-beacon)\n\n\nPEPhotoCropEditor is image cropping library for iOS, similar to the Photos.app UI.\n\n\u003cimg src=\"https://raw.github.com/kishikawakatsumi/PEPhotoCropEditor/master/Screenshots/ss01.png\" alt=\"ScreenShot 1\" width=\"280px\" style=\"width: 280px;\" /\u003e\u0026nbsp;\u003ca href=\"https://vimeo.com/66661806\"\u003e\u003cimg src=\"https://raw2.github.com/kishikawakatsumi/PEPhotoCropEditor/master/Screenshots/movie03.gif\" style=\"width: 242px; height: 476px;\" alt=\"Movie 1\" /\u003e\u003c/a\u003e\n\n\n## Features\n- Both iPhone/iPad available\n- Works fine any device orientations\n- Support pinch gesture to zoom\n- Support rotation gesture\n\n## System requirements\n- iOS 5.0 or higher\n\n## Installation\n### CocoaPods\n`pod 'PEPhotoCropEditor'`\n\n## Usage\n\n**Use view controller component**\n```objective-c\n PECropViewController *controller = [[PECropViewController alloc] init];\n controller.delegate = self;\n controller.image = self.imageView.image;\n \n UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:controller];\n [self presentViewController:navigationController animated:YES completion:NULL];\n```\n\n**Or use the crop view directly**\n```objective-c\nself.cropView = [[PECropView alloc] initWithFrame:contentView.bounds];\n[self.view addSubview:self.cropView];\n```\n\n### Get the cropped image\n\n**delegate method**\n```objective-c\n- (void)cropViewController:(PECropViewController *)controller didFinishCroppingImage:(UIImage *)croppedImage\n{\n    [controller dismissViewControllerAnimated:YES completion:NULL];\n    self.imageView.image = croppedImage;\n}\n```\n\n**retrieve from view directly**\n```objective-c\nUIImage *croppedImage = self.cropView.croppedImage;\n```\n\n### Keep crop aspect ratio while resizing\n```objective-c\ncontroller.keepingCropAspectRatio = YES;\n```\n\n```objective-c\nself.cropView.keepingCropAspectRatio = YES;\n```\n\n### Specify crop rect by image size based \n```objective-c\n// e.g.) Cropping center square\nCGFloat width = image.size.width;\nCGFloat height = image.size.height;\nCGFloat length = MIN(width, height);\ncontroller.imageCropRect = CGRectMake((width - length) / 2,\n                                      (height - length) / 2,\n                                      length,\n                                      length);\n```\n\n```objective-c\n// e.g.) Cropping center square\nCGFloat width = image.size.width;\nCGFloat height = image.size.height;\nCGFloat length = MIN(width, height);\nself.cropView.imageCropRect = CGRectMake((width - length) / 2,\n                                         (height - length) / 2,\n                                         length,\n                                         length);\n```\n\n### Reset back crop rect to original image size and rotation \n```objective-c\n[controller resetCropRect];\n```\n\n```objective-c\n[self.cropView resetCropRect];\n```\n\n\n## License\n\n[Apache]: http://www.apache.org/licenses/LICENSE-2.0\n[MIT]: http://www.opensource.org/licenses/mit-license.php\n[GPL]: http://www.gnu.org/licenses/gpl.html\n[BSD]: http://opensource.org/licenses/bsd-license.php\n\nPEPhotoCropEditor is available under the [MIT license][MIT]. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkishikawakatsumi%2FPEPhotoCropEditor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkishikawakatsumi%2FPEPhotoCropEditor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkishikawakatsumi%2FPEPhotoCropEditor/lists"}