Discussion:
[krita] [Bug 390337] New: Document Object xRes, yRes and Resolution have different values.
(too old to reply)
wolthera
2018-02-12 18:38:02 UTC
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=390337

Bug ID: 390337
Summary: Document Object xRes, yRes and Resolution have
different values.
Product: krita
Version: git master
Platform: Other
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: Scripting
Assignee: krita-bugs-***@kde.org
Reporter: ***@gmail.com
Target Milestone: ---

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...
--
You are receiving this mail because:
You are watching all bug changes.
wolthera
2018-02-12 18:53:20 UTC
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=390337

--- Comment #1 from wolthera <***@gmail.com> ---
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.
--
You are receiving this mail because:
You are watching all bug changes.
wolthera
2018-02-13 13:11:12 UTC
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=390337

wolthera <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Latest Commit| |https://commits.kde.org/kri
| |ta/60b81074027b7cbd68563b84
| |6dc5956b53828d6a
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED

--- Comment #2 from wolthera <***@gmail.com> ---
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
--
You are receiving this mail because:
You are watching all bug changes.
Loading...