Bug 421844 - setResolution, setXRes, setYRes, scaleImage not working
Summary: setResolution, setXRes, setYRes, scaleImage not working
Status: RESOLVED WORKSFORME
Alias: None
Product: krita
Classification: Applications
Component: Scripting (other bugs)
Version First Reported In: 4.3.0-beta1
Platform: macOS (DMG) macOS
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-20 22:33 UTC by Manga Tengu
Modified: 2020-07-31 17:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.