We got Crashed: com.apple.main-thread
0 libsystem_platform.dylib 0x1254 platform_memmove + 420
1 CoreMedia 0xaeffc FigDataByteStreamRead + 120
2 CMPhoto 0x1c824 CMPhotoImageContainerFormatDetectFromBytestream + 368
3 CMPhoto 0x6378 CMPhotoDecompressionContainerCreate + 432
4 ImageIO 0x1f03c AppleJPEGReadPlugin::copyIOSurface(InfoRec*, CGImageProvider*, __CFDictionary const*) + 356
5 ImageIO 0x22964 AppleJPEGReadPlugin::createImageBlockSetWithHardwareDecode(InfoRec*, CGImageProvider*, CGSize, __CFDictionary const*) + 232
6 ImageIO 0x3e0c8 AppleJPEGReadPlugin::copyImageBlockSet(InfoRec*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*) + 1608
7 ImageIO 0x1a774 IIO_Reader::CopyImageBlockSetProc(void*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*) + 280
8 ImageIO 0x16224 IIOImageProviderInfo::copyImageBlockSetWithOptions(CGImageProvider*, CGRect, CGSize, __CFDictionary const*) + 744
9 ImageIO 0x1e2fc IIOImageProviderInfo::CopyImageBlockSetWithOptions(void*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*) + 844
10 CoreGraphics 0x42694 imageProvider_retain_data + 92
11 CoreGraphics 0x60428 CGDataProviderRetainData + 80
12 CoreGraphics 0x7d0b0 provider_for_destination_retain_data + 28
13 CoreGraphics 0x60428 CGDataProviderRetainData + 80
14 CoreGraphics 0x3f3f0 CGAccessSessionCreate + 108
15 CoreGraphics 0xc0e4 img_data_lock + 2404
16 CoreGraphics 0x513ec CGSImageDataLock + 1328
17 CoreGraphics 0x2412c ripc_AcquireRIPImageData + 712
18 CoreGraphics 0x41864 ripc_DrawImage + 824
19 CoreGraphics 0x181b8 CGContextDrawImageWithOptions + 1120
20 UIKitCore 0x1b5db0 -[UIImage drawInRect:blendMode:alpha:] + 980
21 ELStickMeNotes 0x6bce4 specialized static ThemeSV.write(image:) + 111 (UtilMethods.swift:111)
22 ELStickMeNotes 0xd06c0 closure #1 in MyNotesVC.changeBackground() + 4344874688
23 ELStickMeNotes 0x6b364 closure #1 in closure #1 in ThemeSV.collectionView(:didSelectItemAt:) + 4344460132
24 ELStickMeNotes 0x168f24 thunk for @escaping @callee_guaranteed () -> () + 4345499428 (:4345499428)
25 libdispatch.dylib 0x2320 _dispatch_call_block_and_release + 32
26 libdispatch.dylib 0x3eac _dispatch_client_callout + 20
27 libdispatch.dylib 0x126a4 _dispatch_main_queue_drain + 928
28 libdispatch.dylib 0x122f4 _dispatch_main_queue_callback_4CF + 44
29 CoreFoundation 0x98d18 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16
30 CoreFoundation 0x7a650 __CFRunLoopRun + 1992
31 CoreFoundation 0x7f4dc CFRunLoopRunSpecific + 612
32 GraphicsServices 0x135c GSEventRunModal + 164
33 UIKitCore 0x39d37c -[UIApplication _run] + 888
34 UIKitCore 0x39cfe0 UIApplicationMain + 340
35 ELStickMeNotes 0x5b10 main + 20 (AppDelegate.swift:20)
36 ??? 0x1d6accdec (Missing)
This Crash rarely occurs in iPhone 13 Pro Max iOS 16.4.1
The code is below.
func resizeImage(withImage image:UIImage)-> UIImage? {
let height = image.size.height
let width = image.size.width
UIGraphicsBeginImageContext(CGSize(width: width, height: height))
image.draw(in: CGRect(origin: CGPoint.zero, size: CGSize(width: width, height: height)))
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
}