Bug 390418 - Saving layers with python script gives incorrect results
Summary: Saving layers with python script gives incorrect results
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (show other bugs)
Version: 4.0.0-beta.1
Platform: unspecified Unspecified
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-14 02:15 UTC by heff
Modified: 2018-02-14 12:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description heff 2018-02-14 02:15:10 UTC
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)