Huge performance loss with many images loaded on a single note
### Description This could be divided into separate bug reports, but I decided to file a single issue since the root problem lies in one specific area: the poor performance of `insertImage` and `load` from the `DocumentHandler` class. These functions are not only slow, but they also cause significant lag when resizing the window or typing. RAM usage can reach 300–500 MB with only 20 MB of image files. Placing 5–10 different images onto a single note is enough to reproduce the issue. Of course QImage is not cheap, but this is not a good use case at all. A fix is currently in progress. ### Bugs 1. Slow resizing and typing occur if many images are loaded onto a single note. 2. Ctrl+A (Select All) inside notes can also render the UI unresponsive. 3. Huge RAM usage caused by `insertImage` implementation. 4. High CPU usage when typing. 5. Persistent warning: `qt.gui.imageio: libpng warning: eXIf: duplicate` on every `insertImage` call.
issue