[2.0.4] Pattern.resize() does not work in scale-down situations --- possible bug
this possible bug is tracked on GitHub:
https:/
-------
Hello friends, using Sikulix 2.0.4 in Win7 - big trouble when running the script on a different system where the web app to automate is slightly scaled down. SCREEN.find() on the script patterns won't work anymore. So, I try at-runtime code to get the scaling factor for resizing of all the patterns to get find() to work, but SkuliX does not work as expected. Here the issue in 'manual' code:
pat = Pattern(
pat.similar(0.1) # to avoid any FindFaileds
[On the scaled-down environment...]
pat.resize(1)
mat = SCREEN.find(pat)
print(mat.
pat.resize(0.99)
mat = SCREEN.find(pat)
print(mat.
pat.resize(0.98)
mat = SCREEN.find(pat)
print(mat.
"...org.
-> Does not resize the pattern anymore but uses the previous resized pattern as search region!?
pat.resize(0.97) or pat.resize(1.0)
mat = SCREEN.find(pat)
print(mat.
"...org.
-> Very same error details with all different resize values!
***Now closing and restarting the SikuliX IDE ceteris paribus:***
pat.resize(0.98)
mat = SCREEN.find(pat)
print(mat.
-> Now it works, but why?
pat.resize(0.97) or pat.resize(1.0)
mat = SCREEN.find(pat)
print(mat.
"...org.
-> Again, SikuliX bitching around with me, and needs to get restarted which would be, btw, acceptable with my wife, though...
Is this a (known?) bug in SikuliX, or is my understanding of .resize() bad? For sure I don't understand the exception message "image to search (w, h) is larger than image to search in (w, h)" - just makes no sense, also because the search region is SCREEN which is not in there. Please anyone help - I cannot deliver my solution if it cannot determine the needed pattern resizing factor based on a reference pattern for scale-changed applications across different screen resolutions///
Best!
Simon
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: