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

Asked by Federico on 2020-03-19

I'm trying to replicate the first example for the Finder class as seen in the documentation here:

So I have a .sikuli folder, whose content is:
- (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

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
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.

Federico (fedemitic) said : #2


Thanks a lot, that solved my issue.

- Federico