Created attachment 118230 [details]
this has three layers, each layer will have high variation in dimensions when exported via the Export-Layers script.
scripts->"Export Layers" downsizes the exported image dimensions, depending on the alpha values of the layer. This is most apparent when the layer has fully transparent pixels around the border of the image.
STEPS TO REPRODUCE
1. Create a 1024x1024 px krita document.
2. Clear all the layers so that you have a completely transparent document.
3. Paint a small (for example, 2 pixel by 2 pixel) black dot in the center of the image.
3. Run the export layers command (from Tools->Scripts->"Export Layers") on the recently created document/layer.
4. inspect the images that were output by the 'Export Layers' script.
The output images are down-sized depending on the layer's alpha. So, if you only have a 2px-by-2px dot in the layer, the output image size is 2px by 2px.
We'd expect the dimensions of the output image to have the same dimensions as the images in the document (1024x1024, in the case of the repro steps). That's the way that 'File->Export' works.
If the downsizing is a 'feature', we'd expect the feature to be configurable via the "Export Layers" dialog box (it currently isn't).
(available in About System)
KDE Plasma Version:
KDE Frameworks Version:
project that repros this is attached, just open it and run "Tools->scripts->export layers"
I believe this was fixed on December 25th, when an InfoObject parameter was added to the 'Node::Save()' method.
I haven't been able to confirm or deny because I can't get python scripts running on the nightly builds (I haven't investigated too deeply on why this is).
No, the issue is still there. I fixed the export layers script recently so that it doesn't crash anymore with the InfoObject API change, but I guess the way I did it just restored the original behaviour. I will play around with it a bit.
it looks like Rebecca has confirmed this is still a bug and is looking into it. marking this as confirmed.
Created attachment 119414 [details]
Quick fix patch
The save function in Node.cpp uses current layer bounds to create new image to save, this is what causes the layer to only export cropped size.
The patch attached is a quick fix, but if its ok, I can push it later.
Git commit de7fef16da3da6ce2bc690947fd70dc91f27a91f by Ivan Yossi.
Committed on 24/04/2019 at 06:14.
Pushed by ivany into branch 'master'.
Allow selecting boundary limits on python export
save, now accepts an optional bouding region to set
Differential Revision: https://phabricator.kde.org/D20573
M +2 -2 libs/libkis/Node.cpp
M +4 -1 libs/libkis/Node.h
M +1 -1 plugins/extensions/pykrita/sip/krita/Node.sip
M +35 -13 plugins/python/exportlayers/uiexportlayers.py