[krita] [Bug 418494] Document.exportImage doesn't export from the current state of the document

2020-03-18 Thread Boudewijn Rempt
https://bugs.kde.org/show_bug.cgi?id=418494

Boudewijn Rempt  changed:

   What|Removed |Added

 Resolution|--- |WORKSFORME
 CC||b...@valdyas.org
 Status|CONFIRMED   |RESOLVED

--- Comment #3 from Boudewijn Rempt  ---
Ah, you have to explicitly refresh the projection. This works for me:

from krita import *
doc =
Krita.instance().openDocument('/home/boud/bug-exportImage/bug-exportImage.kra')
doc.setBatchmode(True)

for layer in doc.rootNode().childNodes():
if layer.name() == "Layer 3": # has a drawing on it
layer.setOpacity(0)

doc.refreshProjection()

''' Workaround for bug: save, close, reopen
doc.save()
doc.close()
doc = Krita.instance().openDocument('bug-exportImage.kra')
doc.setBatchmode(True)
'''

# BUG? exports from last opened state, instead of saved or current
# so without above workaround, drawing is still visible in png
doc.exportImage('bug-exportImage.png', InfoObject())

doc.close()

-- 
You are receiving this mail because:
You are watching all bug changes.

[krita] [Bug 418494] Document.exportImage doesn't export from the current state of the document

2020-03-07 Thread Rebecca Breu
https://bugs.kde.org/show_bug.cgi?id=418494

Rebecca Breu  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|REPORTED|CONFIRMED

--- Comment #2 from Rebecca Breu  ---
Disregard what I said aboveā€”I got confused.

I do in fact get the issue every time, and neither calling doc.waitForDone()
nor time.sleep(3) before the export solves the problem, nor does disabling
batch mode. So it doesn't seem to be a timing issue as far as I can tell.
Saving and re-opening does seem to be the only "fix".

-- 
You are receiving this mail because:
You are watching all bug changes.

[krita] [Bug 418494] Document.exportImage doesn't export from the current state of the document

2020-03-05 Thread Rebecca Breu
https://bugs.kde.org/show_bug.cgi?id=418494

Rebecca Breu  changed:

   What|Removed |Added

 CC||rebe...@rbreu.de

--- Comment #1 from Rebecca Breu  ---
I have this problem intermittently. Does calling "doc.waitForDone()" before the
export reliably save the issue?

-- 
You are receiving this mail because:
You are watching all bug changes.