Bug 465691

Summary: Scripting: exportImage doesn't export vector layers
Product: [Applications] krita Reporter: Aidin <aidin>
Component: ScriptingAssignee: Krita Bugs <krita-bugs-null>
Status: REPORTED ---    
Severity: normal CC: aidin, greyfox_esb, sejewson
Priority: NOR    
Version First Reported In: 5.1.5   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Aidin 2023-02-13 23:33:17 UTC
SUMMARY

I was writing a script to load all the pages of my graphic novel (separate files) and resize and export them. I noticed that in some files, sometimes, the vector layers aren't included in the exported file. Just like when you hide them.

I attached a simplified version of the script that can reproduce the issue.

STEPS TO REPRODUCE

I can't attach large files here, so I uploaded them to Gitlab. You can find them here: https://gitlab.com/aidin36/sharedstuff/-/tree/master/krita-bug

I attached 02.kra file that often has this issue, and the script and the exported file.

Open the script in your scripter, set the FILE variable to where the 02.kra file located, and run the script.

Sometimes it exports the file correctly. But often, it doesn't.

Even if you comment out the re-size line, the same issue happens.

OBSERVED RESULT

The vector layers are hidden in the exported file. See the 02.kra.png file attached.

EXPECTED RESULT

All visible layers are exported.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu 22.10, kernel: 5.15.0-56-generic
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Krita: 5.1.5 - AppImage
Comment 1 Aidin 2023-02-25 04:26:49 UTC
I tried to flatten the image before export, using Document's flatten() method. But the same thing happened. So, it's not just the export.
Comment 2 WagnerGFX 2023-12-25 18:18:50 UTC
I've been having the same issue when trying to export a project with text layers.
The workaround I've found is to NOT enable Batch Mode. The export window will pop up multiple times, but at least the text will be rendered.

If confirmed, this seems like a bug specific for exporting in batch mode.

SOFTWARE/OS VERSIONS
Windows 10 22H2
Krita 5.2.2
Comment 3 Sabrina Jewson 2025-08-17 16:17:17 UTC
A workaround I found is simply waiting a while before exporting the image (sometimes up to 0.5s is necessary). I expect that the reason why disabling batch-mode works is that is forces that delay to be present.