java.lang.IllegalArgumentException for Finder Class using valid .png file --- workaround until fixed in 2.0.5 see comment #1

Asked by Federico

I'm trying to replicate the first example for the Finder class as seen in the documentation here:
https://sikulix-2014.readthedocs.io/en/latest/finder.html#Finder

So I have a .sikuli folder, whose content is:
- script.py (the same as the first example, the same name as the folder name)
- stars.png
- star.png

However, whenever I try to execute the code I get the following error:

java.lang.IllegalArgumentException ( java.lang.IllegalArgumentException: Finder: not possible with: stars.png ) on the first line, which is:

f = Finder("stars.png")

I double-checked (many times) that all the png are in the folder and tried using also absolute path (I checked with the module os.path that they were read as valid files); indeed the thumbnails of the images are correctly shown in the IDE.

My system details:
Writing on SikuliX IDE version 2.0.4-2020-03-14_08:01
Windows 10.0
Java8(64) 1.8.0_241-b07.

Let me know if additional details are needed.

- Federico

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:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

Sorry, for the inconveniences. This is simply a bug.

Instead of
f = Finder("stars.png")

use as a workaround
f = Finder(Image.create("stars.png"))

With version 2.0.5 your first approach will be available again.

Revision history for this message
Federico (fedemitic) said :
#2

Hi,

Thanks a lot, that solved my issue.

- Federico