1. Make a document with 72 dpi. 2. Go to scripter. 3. Execute following script: ----------------------------------- import sys from krita import * doc = Application.activeDocument() print(doc.resolution()) print(doc.xRes()) print(doc.yRes()) ----------------------------------- Note that resolution is 72, but xRes and yRes are 1.0... I am somewhat lost which ones need to go into ScaleImage now...
So, uh, this is kinda serious bug, but I cannot fix it due to to not really undrstnading it. Thing is, Krita for some reason assumes xRes and yRes are 1.0, which means they are 72 dpi. LibKis multiplies xRes by 72 dpi to give document.resolution() document.scaleNode requests regular xRes and yRes though. LiKis also doesn't allow setting the DPI of created documents, which are always set to 100, which SHOULD be 1.0 if it needs to be 72 dpi. (Like in Krita Sketch ImageBuilder::createBlankImage(int width, int height, int resolution) ) Which means that newly created images are always at 7200 dpi. I uh, I am not sure how we should resolve all of this.
Git commit 60b81074027b7cbd68563b846dc5956b53828d6a by Wolthera van Hövell tot Westerflier. Committed on 13/02/2018 at 13:08. Pushed by woltherav into branch 'master'. I am not sure why we have this crazy system at all... M +5 -5 libs/libkis/Document.cpp https://commits.kde.org/krita/60b81074027b7cbd68563b846dc5956b53828d6a