CreativeSDK / phonegap-plugin-csdk-image-editor

A PhoneGap plugin for the Creative SDK Image Editor.
Apache License 2.0
35 stars 15 forks source link

App crashes on iOS returning from landscape orientation #31

Open rknell opened 7 years ago

rknell commented 7 years ago

Expected Behaviour

App does not crash

Actual Behaviour

App crashes with error:

CGAffineTransformInvert: singular matrix. Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]' First throw call stack: ( 0 CoreFoundation 0x000000010aae7b0b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010a523141 objc_exception_throw + 48 2 CoreFoundation 0x000000010ab50625 +[NSException raise:format:] + 197 3 QuartzCore 0x0000000108ad70be _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 152 4 QuartzCore 0x0000000108ad7231 -[CALayer setPosition:] + 43 5 QuartzCore 0x0000000108ad7851 -[CALayer setFrame:] + 610 6 UIKit 0x0000000108d60fe9 -[UIView(Geometry) setFrame:] + 845 7 Forwood Beta 0x00000001069775e6 -[AVYScrollableImageView layoutSubviews] + 1166 8 UIKit 0x0000000108d8055b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1268 9 QuartzCore 0x0000000108ae0904 -[CALayer layoutSublayers] + 146 10 QuartzCore 0x0000000108ad4526 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 370 11 QuartzCore 0x0000000108ad43a0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 12 QuartzCore 0x0000000108a63e92 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294 13 QuartzCore 0x0000000108a90130 _ZN2CA11Transaction6commitEv + 468 14 QuartzCore 0x0000000108a90b37 _ZN2CA11Transaction17observer_callbackEP19CFRunLoopObservermPv + 115 15 CoreFoundation 0x000000010aa8d717 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 16 CoreFoundation 0x000000010aa8d687 CFRunLoopDoObservers + 391 17 CoreFoundation 0x000000010aa72720 __CFRunLoopRun + 1200 18 CoreFoundation 0x000000010aa72016 CFRunLoopRunSpecific + 406 19 GraphicsServices 0x000000010d21da24 GSEventRunModal + 62 20 UIKit 0x0000000108cbd134 UIApplicationMain + 159 21 Forwood Beta 0x00000001066440d1 main + 65 22 libdyld.dylib 0x000000010c32965d start + 1 23 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException

Reproduce Scenario (including but not limited to)

App in landscape orientation, edit image, keep in landscape (even though UI in in portrait), draw something on the photo, click apply, click done. App crashes.

Steps to Reproduce

App in landscape orientation, edit image, keep in landscape (even though UI in in portrait), draw something on the photo, click apply, click done. App crashes.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS 10.3

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Not a problem in Android iOS can reproduce on iPad mini, as well as simulator iPhone 7

PhoneGap CLI version and PhoneGap platform version

cordova --version   **7.0.1**
phonegap platform version android      **ios 4.4.0**

Plugin version

cordova plugin version | grep phonegap-plugin-csdk-image-editor  **phonegap-plugin-csdk-image-editor 1.0.0 "phonegap-plugin-csdk-image-editor"**

Sample Code that illustrates the problem

Don't have anything easy to pass over.

Logs taken while reproducing problem

Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]' First throw call stack: ( 0 CoreFoundation 0x000000010aae7b0b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010a523141 objc_exception_throw + 48 2 CoreFoundation 0x000000010ab50625 +[NSException raise:format:] + 197 3 QuartzCore 0x0000000108ad70be _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 152 4 QuartzCore 0x0000000108ad7231 -[CALayer setPosition:] + 43 5 QuartzCore 0x0000000108ad7851 -[CALayer setFrame:] + 610 6 UIKit 0x0000000108d60fe9 -[UIView(Geometry) setFrame:] + 845 7 Forwood Beta 0x00000001069775e6 -[AVYScrollableImageView layoutSubviews] + 1166 8 UIKit 0x0000000108d8055b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1268 9 QuartzCore 0x0000000108ae0904 -[CALayer layoutSublayers] + 146 10 QuartzCore 0x0000000108ad4526 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 370 11 QuartzCore 0x0000000108ad43a0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 12 QuartzCore 0x0000000108a63e92 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294 13 QuartzCore 0x0000000108a90130 _ZN2CA11Transaction6commitEv + 468 14 QuartzCore 0x0000000108a90b37 _ZN2CA11Transaction17observer_callbackEP19CFRunLoopObservermPv + 115 15 CoreFoundation 0x000000010aa8d717 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 16 CoreFoundation 0x000000010aa8d687 CFRunLoopDoObservers + 391 17 CoreFoundation 0x000000010aa72720 __CFRunLoopRun + 1200 18 CoreFoundation 0x000000010aa72016 CFRunLoopRunSpecific + 406 19 GraphicsServices 0x000000010d21da24 GSEventRunModal + 62 20 UIKit 0x0000000108cbd134 UIApplicationMain + 159 21 Forwood Beta 0x00000001066440d1 main + 65 22 libdyld.dylib 0x000000010c32965d start + 1 23 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException

rknell commented 7 years ago

Hey guys,

Just checking if this is the right place for this one or should I be reporting it to another team? It looks as though it might be an error in the actual SDK framework instead of here, but figured this was the best place to reproduce it.

If you need any more feedback please let me know.

macdonst commented 7 years ago

@ashryanbeats can you surface this bug up to the right folks or point @rknell to the right spot to open the bug.