How to simplify this code for ESP32CAM?

Hi,
The attached file can't upload because it is too large, is it possible to simplify it and how?
Thanks
Adam

CameraWebServer.ino (3.8 KB)

Hi, @shanren ,
try this partition scheme to increase the progrm memory.

RV mineirin

wonderful !
Thank you.

If resolved, mark as resolved.

RV mineirin

Thanks.
Done.
The new question from here is, the OLED didn't show as expected see the picture attached, why?

0.1