TimOliver / TOCropViewController

A view controller for iOS that allows users to crop portions of UIImage objects
http://www.timoliver.com.au/2015/06/21/tocropviewcontroller-an-open-source-image-cropper-for-ios/
MIT License
4.73k stars 951 forks source link

Crop Image in Background #225

Closed rakeshkathoju closed 6 years ago

rakeshkathoju commented 6 years ago

how can i crop image without invoking/Presenting TOCropViewController. I want to return cropped image by assigning crop ratio and original image to cropView

Thanks for considering filing an issue! Before proceeding, please consider the type of issue you're filing and make sure to supply the proper details needed for it! :)

Please note that your issue may be closed without review if you do not supply the information that is requested here. Since this library is done as a side-project outside of work hours, please understand that a timely response cannot be guaranteed. ;)

For CocoaPods Users

Before filing a bug report, please make sure you are using the latest version of CocoaPods (gem install cocoapods), and the latest version of this library (pod repo update).

Support for CocoaPods-related issues is not provided unless you confirm both of these points in your submission.

Issue Types

Questions: Please check the closed issues to see if it's already been asked before.

Feature Request: Please fill in just the first two sections. Please be as thorough as possible and explain how you would expect this feature to work both visually, and from an API perspective.

Bugs: Please be as thorough as possible when describe the bug you've discovered. If it's a visual bug, please add a screenshot. If it's an animation bug, please provide a recording of the bug in action.


Hardware / Software

Which version of the library were you using? Which version of iOS are you running? What model of iOS device were you testing on? If using CocoaPods, which version of CocoaPods are you on?

Goals

What is the outcome result you want to achieve with this library?

Expected Results

What did you expect to happen?

Actual Results

What happened instead? (Please attach a screenshot/screen recording if possible)

Steps to Reproduce

What are the steps needed to reproduce this issue? If this bug was caused by a specific image, please post it here.

TimOliver commented 6 years ago

This is a bit out of scope for this library. The whole point is to provide a UI for cropping operations. 😜

All of the code for actually performing the crop is located here:

https://github.com/TimOliver/TOCropViewController/blob/master/Objective-C/TOCropViewController/Models/UIImage%2BCropRotate.m

You should be able to import and use that category directly, or if you don’t need TOCropViewController, you can just copy the files out directly.

Good luck!