Image from disk problem

Asked by Paul Ricco

I'm trying to insert an image from the disk to use in a script but everytime I do so the image isn't displayed properly within the script. Instead I see a squashed box with no image inside of it. If I then save the script the image then becomes a file that is empty (albeit with the same name).

What is the recommended way to store images to use in scripts? Currently I've been capturing images and putting them in the same directory as the script itself (where the Sikuli captured images are).

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Paul Ricco
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

When using images, that you have captured with another tool than Sikuli IDE, they currently should not be in the script folder (where Sikuli stores captured images), since when saving, the directory is cleaned up according pictures that are not used and there is a bug on top that may delete pictures, that are still in use.

recommendation: use a subdirectory (e.g. myStuff) in the script folder, where you store your own images. They should be PNG-files, using the suffix .png (lowercase!!).

How to:
myDir = getLibPath()+"\\myStuff\\"
img1 = myDir+"a-picture.png"
m = find(img1)

If you use the "load picture ..." button in the IDE, the pictures should not be in the script folder, since this feature is a convenience to copy the respective picture into the script folder. And they should be PNG-files using suffix .png (lowercase!!).

many users, especially those building large and flexible testing environments are storing their pictures in a central repository and are using in their .skl-scripts "setBundlePath()" to specify the image directory for the script. They normally only use the IDE to test some workflows, but never to build their tests (many are working with eclipse and comparable IDE's).

Revision history for this message
Paul Ricco (pricco) said :
#2

OK thanks for that.

I think I'm going to try and use Eclipse so that I can create a suite of tests that run from the command line and record results in a log. Are there any instructions around for setting up Sikuli in Eclipse (or other IDEs)?