SUMMARY In my work I commonly have to draw on files that are roughly 2000 x 40,000px in size. When saving files and coming back to them I will notice that some vector objects fail to load, meaning that they are "invisible". If you click on an "invisible" object and drag it to a new location it will appear again like normal. I noticed that this only happens towards the bottom of the file, around past 20,000 px down. Usually above that in the top half of the image the objects load just fine without issues. STEPS TO REPRODUCE 1. Open a large file size; (Ex. 2000 x 40,000px) 2. Create a Vector Layer and put in Objects throughout the file (In my line of work this is commonly "Text") 3. Save File, then reload. OBSERVED RESULT Vector objects at a certain point are invisible upon reopening the file. EXPECTED RESULT Vector objects able to be seen. SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
Hi, Thanks for your report. I can easily confirm the issue.
as note to myself. it stops rendering after pixel 32768, which coincidentally is max limit of a short in C++.
This is actually a limit in qpainter/qimage api: see for instance https://stackoverflow.com/questions/7080052/qimage-qpixmap-size-limitations. To avoid this we should implement rendering to tiles instead of one big QImage in KisShapeLayerCanvas. This is quite a job, but not impossible. An impossible but interesting alternative would be to implement a QPainterEngine that works directly on a KisPaintDevice.
Proposed fix https://invent.kde.org/kde/krita/merge_requests/74
Git commit 909348366cad0ee3d4facc82b7ffb0da147437ea by Ivan Yossi. Committed on 08/10/2019 at 03:07. Pushed by ivany into branch 'master'. Render maxSize image tiles for vector repaints Paint the image in tiled chunks of 256x256 Qrects, this makes it possible to render vector shapes on images bigger than QImage limits M +29 -17 libs/ui/flake/kis_shape_layer_canvas.cpp https://invent.kde.org/kde/krita/commit/909348366cad0ee3d4facc82b7ffb0da147437ea
Git commit 5376c52b928e6a3d5a7007c9304c4e32e5d1b167 by Boudewijn Rempt, on behalf of Ivan Yossi. Committed on 09/10/2019 at 08:40. Pushed by rempt into branch 'krita/4.2'. Render maxSize image tiles for vector repaints Paint the image in tiled chunks of 256x256 Qrects, this makes it possible to render vector shapes on images bigger than QImage limits (cherry picked from commit 909348366cad0ee3d4facc82b7ffb0da147437ea) M +29 -17 libs/ui/flake/kis_shape_layer_canvas.cpp https://invent.kde.org/kde/krita/commit/5376c52b928e6a3d5a7007c9304c4e32e5d1b167