Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itouch2/PhotoTweaks
Drag, Rotate, Scale and Crop
https://github.com/itouch2/PhotoTweaks
crop drag objective-c photos
Last synced: about 2 months ago
JSON representation
Drag, Rotate, Scale and Crop
- Host: GitHub
- URL: https://github.com/itouch2/PhotoTweaks
- Owner: itouch2
- License: mit
- Created: 2014-11-28T02:12:33.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-02-27T02:23:07.000Z (almost 4 years ago)
- Last Synced: 2024-11-18T04:56:48.423Z (2 months ago)
- Topics: crop, drag, objective-c, photos
- Language: Objective-C
- Homepage:
- Size: 947 KB
- Stars: 1,262
- Watchers: 43
- Forks: 167
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PhotoTweaks
PhotoTweaks is an interface to crop photos. It can let user drag, rotate, scale the image, and crop it. You will find it mimics the interaction of Photos.app on iOS 8. :]
[![Pod Version](http://img.shields.io/cocoapods/v/PhotoTweaks.svg?style=flat)](http://cocoapods.org/?q=PhotoTweaks)
[![Platform](http://img.shields.io/cocoapods/p/PhotoTweaks.svg?style=flat)](http://cocoapods.org/?q=PhotoTweaks)
[![License](http://img.shields.io/cocoapods/l/PhotoTweaks.svg?style=flat)](https://github.com/itouch2/PhotoTweaks/blob/master/LICENSE)## Usage
PhotoTweaksViewController offers all the operations to crop the photo, which includes translation, rotate and scale.
To use it,
```objective-c
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
PhotoTweaksViewController *photoTweaksViewController = [[PhotoTweaksViewController alloc] initWithImage:image];
photoTweaksViewController.delegate = self;
photoTweaksViewController.autoSaveToLibray = YES;
photoTweaksViewController.maxRotationAngle = M_PI_4;
[picker pushViewController:photoTweaksViewController animated:YES];
``````maxRotationAngle``` is the property to set the maximum supported rotation angle.
Get the cropped image
```objective-c
- (void)photoTweaksController:(PhotoTweaksViewController *)controller didFinishWithCroppedImage:(UIImage *)croppedImage
{
[controller.navigationController dismissViewControllerAnimated:YES completion:nil];
// cropped image
}
```
## Installation
PhotoTweaks is available on [CocoaPods](http://cocoapods.org). Add the follwing to your Podfile:
```ruby
pod 'PhotoTweaks', '~> 1.0.4'
```
Alternatively, you can manually drag the ```PhotoTweaks``` folder into your Xcode project.## A Quick Peek
![screenshots](https://cloud.githubusercontent.com/assets/4316898/6712965/84ab1d16-cdca-11e4-912a-f437bbb02d42.gif)
## Protip
If using with an existing UIImagePickerController, be sure to set ```allowsEditing = NO``` otherwise you may force the user to crop with the native editing tool before showing PhotoTweaksViewController.