When using the Node::save() function of libkis in python, the data that is saved does not take into account the position of the layer, and as such saves the wrong data. The width and height of the layer is respected, but the data seems to always be pulled from the top left. To reproduce: Enable the exportslayers python plugin and create a layer that does not fill the canvas fully and has no content in the top left corner, then export. Quick speculation: I'm new to this codebase, and currently do not have a setup available to properly debug, but peeking at the code I'm guessing that the intersection calculation in KisPaintDevice::makeCloneFrom is given invalid bounds data, and that's where I'd start looking for a trace. (https://phabricator.kde.org/source/krita/browse/master/libs/image/kis_paint_device.cc)
Resolved: https://phabricator.kde.org/R37:3928c0453ebe655eaab525e2ec96858ae2c47611