kishikawakatsumi / PEPhotoCropEditor

Image cropping library for iOS.
MIT License
1.09k stars 358 forks source link

Crash when user drag one corner of the resize control #33

Open madspacer opened 10 years ago

madspacer commented 10 years ago

How to reproduce: drag one corer of the resize control slowly to the opposite corner to resize the image until the control disappears.

2014-02-10 14:41:44.312 FreshRookies[31561:70b] * Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [-5 nan]' * First throw call stack: ( 0 CoreFoundation 0x02d1e5e4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x028378b6 objc_exception_throw + 44 2 CoreFoundation 0x02d1e3bb +[NSException raise:format:] + 139 3 QuartzCore 0x011a4caa _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 190 4 QuartzCore 0x011a4e69 -[CALayer setPosition:] + 68 5 QuartzCore 0x011a556f -[CALayer setFrame:] + 799 6 UIKit 0x0143e72c -[UIView(Geometry) setFrame:] + 302 7 FreshRookies 0x001896c4 -[PECropRectView resizeControlViewDidResize:] + 260 8 FreshRookies 0x00198b42 -[PEResizeControl handlePan:] + 978 9 UIKit 0x0175fe8c _UIGestureRecognizerSendActions + 230 10 UIKit 0x0175eb00 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 383 11 UIKit 0x0176056d -[UIGestureRecognizer _delayedUpdateGesture] + 60 12 UIKit 0x01763acd ___UIGestureRecognizerUpdate_block_invoke + 57 13 UIKit 0x01763a4e _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 317 14 UIKit 0x0175a148 _UIGestureRecognizerUpdate + 199 15 UIKit 0x0142619a -[UIWindow _sendGesturesForEvent:] + 1291 16 UIKit 0x014270ba -[UIWindow sendEvent:] + 1030 17 UIKit 0x013fae86 -[UIApplication sendEvent:] + 242

kishikawakatsumi commented 10 years ago

Thank you reporting. I will investigate and fix it.

JayGajjar commented 8 years ago

Getting same error. Only when i use self.cropView.keepingCropAspectRatio = true; self.cropView.cropAspectRatio = 16.0 / 9.0; Can you please provide me a quick solution ?