Camera Plugin - IOS app crash if I select more than 30 photos with pickImage
Bug Report
Plugin(s)
Camera ver. 4.1.1
Capacitor Version
Capacitor CLI : 4.1.0 @capacitor/android : 4.1.0 @capacitor/core : 4.1.0 @capacitor/ios : 4.1.0
2022-09-26 15:57:01.236175+0200 App[1997:145845] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)"" 2022-09-26 15:57:01.250580+0200 App[1997:145846] [PAAccessLogger] Failed to log access with error: access=<PATCCAccess 0x280bdd630> accessor:<<PAApplication 0x280b9d810 identifierType:auditToken identifier:{pid:1997, version:5768}>> identifier:C9F48578-7A97-4C93-A207-AC63CFDB36F5 kind:intervalEvent timestampAdjustment:0 visibilityState:0 assetIdentifierCount:0 tccService:kTCCServicePhotos, error=Error Domain=NSCocoaErrorDomain Code=4097 "connection to service with pid 1941 named com.apple.privacyaccountingd" UserInfo={NSDebugDescription=connection to service with pid 1941 named com.apple.privacyaccountingd} 2022-09-26 15:57:06.410345+0200 App[1997:145845] [Unknown process name] CGSImageDataLock: Cannot allocate memory 2022-09-26 15:57:06.537880+0200 App[1997:145845] [Unknown process name] CGSImageDataLock: Cannot allocate memory 2022-09-26 15:57:06.656177+0200 App[1997:145845] IOSurface creation failed: e00002bd parentID: 00000000 properties: { IOSurfaceAllocSize = 48771072; IOSurfaceBytesPerElement = 4; IOSurfaceBytesPerRow = 16128; IOSurfaceCacheMode = 0; IOSurfaceHeight = 3024; IOSurfaceMapCacheAttribute = 1; IOSurfaceName = CMPhoto; IOSurfaceOffset = 0; IOSurfacePixelFormat = 1111970369; IOSurfacePreallocPages = 0; IOSurfaceWidth = 4032;
Platform(s)
iOS
Current Behavior
I call Camera.pickImage and select 33 photos (with 30 or less the problem doesn't show up), after showing mani error like CGSImageDataLock: Cannot allocate memory and IOSurface creation failed the app crash
Expected Behavior
present an error before at the first memory error, or even better select many image without memory problem
Code Reproduction
let opt: GalleryImageOptions = { correctOrientation: true, quality: 80, limit: 0 } let results;
results = await Camera.pickImages(opt);
Simple app to open camera, select 30 photos or more and the app will crash or give error https://github.com/Missile71/testCapacitorCamera
Additional Context
many suggestion online talk about release resources after create image
This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue.
Please see the Contributing Guide for how to create a Code Reproduction.
Thanks! Ionitron 💙
Added a sample app, when I open more than 30 photos app crash, I have an IPhone X, in an iPhone 13 crash after 33-36 photos
Any updates on this?