Hi, we've recently upgraded from 2.28.2 to 2.31.0 and start seeing multiple crashes. I've attached some crash logs.
We are using SwiftUI and all crash are on iOS/iPadOS 26.0+. I suspect that these crashed are related to work on support perspective skew correction in 2.29.0 which in that commit the cropView get a big rewrite and somewhere that there is a missing handling of NaN frame or zoomLevel.
Thread 0 Crashed:
0 MyApp 0x000000010329a1c4 Swift runtime failure: Double value cannot be converted to Int because it is either infinite or NaN + 0 (CGImageExtensions.swift:48)
1 MyApp 0x000000010329a1c4 CGImageRef.transformedImage(_:outputSize:cropSize:imageViewSize:) + 1056
2 MyApp 0x0000000103299e40 CGImageRef.transformedImage(_:outputSize:cropSize:imageViewSize:) + 156 (CGImageExtensions.swift:42)
3 MyApp 0x000000010329a7bc UIImage.crop(by:) + 292 (UIImageExtensions.swift:110)
4 MyApp 0x000000010328870c CropView.crop(_:) + 40 (CropViewController+CropAPI.swift:36)
5 MyApp 0x000000010328870c CropView.crop() + 40
6 MyApp 0x000000010328870c protocol witness for CropViewProtocol.crop() in conformance CropView + 40
7 MyApp 0x000000010328870c CropViewController.crop() + 516
8 MyApp 0x00000001032869c8 CropToolbar.crop(_:) + 84 (/<compiler-generated>:309)
9 MyApp 0x00000001032869c8 @objc CropToolbar.crop(_:) + 152
10 UIKitCore 0x000000019321edd0 -[UIApplication sendAction:to:from:forEvent:] + 100 (UIApplication.m:5887)
11 UIKitCore 0x0000000192af5810 -[UIControl sendAction:to:forEvent:] + 112 (UIControl.m:982)
12 UIKitCore 0x0000000192af5b54 -[UIControl _sendActionsForEvents:withEvent:] + 376 (UIControl.m:1071)
13 UIKitCore 0x0000000192af25c4 -[UIButton _sendActionsForEvents:withEvent:] + 204 (UIButton.m:4240)
14 UIKitCore 0x0000000192af46d8 -[UIControl touchesEnded:withEvent:] + 432 (UIControl.m:724)
15 UIKitCore 0x000000019324f01c -[UIWindow _sendTouchesForEvent:] + 848 (UIWindow.m:3435)
16 UIKitCore 0x000000019325047c -[UIWindow sendEvent:] + 2940 (UIWindow.m:3756)
17 UIKitCore 0x00000001932332bc -[UIApplication sendEvent:] + 368 (UIApplication.m:13014)
18 UIKitCore 0x0000000191f10d70 __dispatchPreprocessedEventFromEventQueue + 1076 (UIEventDispatcher.m:2711)
19 UIKitCore 0x0000000191f1fe2c __processEventQueue + 4812 (UIEventDispatcher.m:3069)
20 UIKitCore 0x0000000191f12c88 updateCycleEntry + 172 (UIEventDispatcher.m:136)
21 UIKitCore 0x0000000191f20ee8 _UIUpdateSequenceRunNext + 128 (_UIUpdateSequence.mm:189)
Fatal Exception: CALayerInvalidGeometry
0 CoreFoundation 0xc98c8 __exceptionPreprocess
1 libobjc.A.dylib 0x317c4 objc_exception_throw
2 CoreFoundation 0x1548d4 -[NSException initWithCoder:]
3 QuartzCore 0x909b8 CA::Layer::set_position(CA::Vec2<double> const&, bool)
4 QuartzCore 0x2af298 -[CALayer setPosition:]
5 QuartzCore 0x2aefac -[CALayer setFrame:]
6 UIKitCore 0xe9f944 -[UIView _backing_setFrame:]
7 UIKitCore 0x18fab20 -[UIView(Geometry) setFrame:]
8 MyApp 0x8fe2d0 @objc CropAuxiliaryIndicatorView.frame.setter (<compiler-generated>)
9 MyApp 0x90cc0c CropView.handleCropBoxFrameChange(_:) + 166 (CropView.swift:166)
10 MyApp 0x90cb9c closure #2 in CropView.init(image:cropViewConfig:viewModel:cropAuxiliaryIndicatorView:imageContainer:cropWorkbenchView:cropMaskViewManager:) + 152 (CropView.swift:152)
11 MyApp 0x90668c handleRotateAnimation #1 () in CropView.rotateBy90(withRotateType:completion:) + 65 (CropViewModel.swift:65)
12 MyApp 0x197bfc <deduplicated_symbol>
13 UIKitCore 0x1905b9c +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:]
14 UIKitCore 0x1906230 +[UIView(UIViewAnimationWithBlocks) animateWithDuration:animations:completion:]
15 MyApp 0x906524 CropView.rotateBy90(withRotateType:completion:) + 245 (CropView+Rotation.swift:245)
16 MyApp 0x91ac40 specialized CropViewController.didSelectCounterClockwiseRotate(_:)
17 MyApp 0x91a7ec CropViewController.didSelectCounterClockwiseRotate(_:) (<compiler-generated>)
18 MyApp 0x916438 @objc CropToolbar.counterClockwiseRotate(_:) + 285 (CropToolbar.swift:285)
Hi, we've recently upgraded from
2.28.2to2.31.0and start seeing multiple crashes. I've attached some crash logs.We are using SwiftUI and all crash are on iOS/iPadOS 26.0+. I suspect that these crashed are related to work on support perspective skew correction in
2.29.0which in that commit the cropView get a big rewrite and somewhere that there is a missing handling ofNaNframe or zoomLevel.