Bug 421844

Summary: setResolution, setXRes, setYRes, scaleImage not working
Product: [Applications] krita Reporter: Manga Tengu <mangatengu>
Component: ScriptingAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: scottpetrovic
Priority: NOR    
Version First Reported In: 4.3.0-beta1   
Target Milestone: ---   
Platform: macOS (DMG)   
OS: macOS   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Manga Tengu 2020-05-20 22:33:27 UTC
Make a new image via the scripting tool, the image resolution should be 288 ppi no matter how you try to change it:

I tried scaleImage, setResolutionn setXRes and seYRes without success.
Comment 1 Scott Petrovic 2020-07-31 14:52:34 UTC
I just tried the setResolution(), which seems to work for me. Maybe it is a specific issue for Macs. See if this works. For Python stuff, we can probably use Krita artists to start off any issues. That will probably get to the root of the issue, or if it is just related to how it is scripted.

from krita import *

# create document and show in view
doc = Krita.instance().createDocument(1280, 1024, "Document name", "RGBA", "U8", "", 300.0)
view = Krita.instance().activeWindow().addView(doc) # shows it in the application
window = Application.activeWindow()

doc.setResolution(123)
Comment 2 Manga Tengu 2020-07-31 17:32:12 UTC
I'm a bit lost here, I tried it for the nth time and now it works. In between there was OS and Krita upgrades so It's hard for me to tell where it comes from.
Comment 3 Scott Petrovic 2020-07-31 17:36:18 UTC
Alright. We can close this for now. If something else pops up we can make a new ticket. There has been quite a few fixes happening in the past couple months, so maybe it got fixed with something else.