I've tried in ObjectiveC, following this and this
and I have same crash with very big files of more than 25MB
# https://gist.github.com/jsbain/389a67c5aacb097b87fd
# https://github.com/tdamdouni/Pythonista/blob/master/_2017/core_image.py
import ui
from objc_util import *
import ctypes
import os
iv = ui.ImageView()
iv.image = ui.Image.named('P1020096.JPG') # 3888 x 2592 pixels
wi,hi = iv.image.size
iv.frame = (0,0,wi,hi)
print(wi,hi) # 3888 2592
w = 7000
h = w*hi/wi
print(w,h) # 7776 5184
with ui.ImageContext(w,h) as ctx:
iv.draw_snapshot()
ui_image = ctx.get_image()
uio = ObjCInstance(ui_image)
c.UIImageJPEGRepresentation.argtypes = [c_void_p, CGFloat]
c.UIImageJPEGRepresentation.restype = c_void_p
quality = 1.0
data = ObjCInstance(c.UIImageJPEGRepresentation(uio.ptr, quality))
filename = os.path.abspath('t1.jpg')
data.writeToFile_atomically_(filename, True)