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

Disable Zooming of Image #290

Open ManishaQw opened 6 years ago

ManishaQw commented 6 years ago

Question: How to get cropped image with fixed width and height?

Hardware / Software

Version of library: 2.3.6 iOS version: 11.4 iOS device: 5s, 7 CocoaPods version: 1.5.0

Expected Results

After zoom out image resolution will not vary.

Actual Results

when zooming out image width and height reduces.

Steps to Reproduce

Fixed the crop area by this line of code cropViewController.cropView.cropBoxResizeEnabled = false created custom aspect ratio TOCropViewControllerAspectRatioPreset1920x680

TimOliver commented 6 years ago

Thanks for the issue @ManishaQw!

As far as I can recall, the library doesn't support disabling zooming of the scroll view. It's probably pretty easy if anyone wants to add it though!

Pranshu88 commented 6 years ago

We are too facing an issue when i start cropping the image ,the image gets zoom in along with the cropbox.

We really want that image should not zoom in only the dropbox would rotate.It would be grateful if you provide some help regarding that.

TimOliver commented 5 years ago

Hey folks! @cupnoodle made a PR to disable the ability to use pinching to zoom images, but I'm getting the feeling that's not what the two of you are requesting here. I had a play with that, but it feels so broken that I don't think it's a good idea to add.

Are you instead requesting that after you change the shape of the crop box, the reset animation where all of the content zooms in to fill the screen around the crop box is disabled instead?

ashishpatill commented 5 years ago

@TimOliver I have enabled the circular mode and changed the shape of crop box to 3:4. I have also added provision to update crop view with new image from a crop picker collection view below. However I am not able to solve this issue when image keeps zooming in when new image is assigned to crop view. I am tweaking the "setup" method in "ToCropView". Any help what I am missing here.

TimOliver commented 5 years ago

@ashishpatill Hi Ashish! Uh, it might be better to open a new issue instead of posting that in here. :)

ashishpatill commented 5 years ago

@TimOliver Ok Done.