Loading and reloading scripts shows or doesn't show images

Asked by Dale on 2017-02-11

I have the setting "delete unused images" UNchecked, so my images should never be deleted.

Yet, when I load a script, many times I'll have file names instead of images showing.

If I close and re-open a script, more images usually show-up, but some images are more stubborn, and don't show.

If I rename the image in the script (for instance, add an "a" to the file name), and also add the "a" to the file name in the script, then close and re-open the script, the image will probably finally show.

Is there a way to somehow flush the cache, force a compile, SOMETHING, where I could get this to work better?

I'd be willing to write code that would run before the IDE opened to make sure that, when I want to edit a script, I can actually see the images without all of the shuck and jive.

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Best RaiMan (raimund-hocke) said : #1

Try version 1.1.1 (http://sikulix.com)

Dale (sengsational) said : #2

Thank you for the quick response and for maintaining this very handy application.

It appears that the images all get loaded now.

If you're ever in Charlotte, NC, I'll buy you a beer.

Dale (sengsational) said : #3

Thanks RaiMan, that solved my question.

Alex Lunyov (lunyov-av) said : #4

Hi, it's nice to come back here (would like report some possible bugs). So, I updated my Sikuli to 1.1.1 2017-03-03 and I noticed that updating images didn't work as expected (as it had worked before).

1. I create some image visual:

img = "img.png" # using screen-capture button

2. Then I decide to change this image, type Backspace to delete old image:

img = # img.png should be deleted, shouldn't it?

3. I choose another part of the screen using screen-capture button :

img = "img.png" #

Surprisingly I see my _old image_ instead of the new one. But when I save the project and reopen it in Sikuli IDE I do see the new image.

RaiMan (raimund-hocke) said : #5

thanks for finding. Made it a bug
The reason behind:
changing the imagefile content is not reflected in image caching (which is on by default)

Alex Lunyov (lunyov-av) said : #6


RaiMan (raimund-hocke) said : #7

fixed. the new version is on the nightly page.

Alex Lunyov (lunyov-av) said : #8

@RaiMan, thanks!

RaiMan (raimund-hocke) said : #9


Alex Lunyov (lunyov-av) said : #10

Yes, RaiMan, I've tested, this works well.
Some related problem (just to let you know if it is a bug).

On Windows 7: I press the image-capture button and my IDE with script text disappeares and I see my visual targets to be used in the script.
On Windows 10: I do the same, but IDE window doesn't dissappear, it disturbes. I need to use ctrl+shift+2 combination to capture image from the target applications.

Alex Lunyov (lunyov-av) said : #11

*shortly speaking, I use this key combination instead of using image-capture button because the IDE window screens my visual targets while capturing mode is running.

RaiMan (raimund-hocke) said : #12

Thanks for confirming.

if the IDE does not disappear completely, after clicking the capture button, either:
- switch of window animation in Windows setup
- increase the pause-before-shot in the IDE preferences

Alex Lunyov (lunyov-av) said : #13

The second advice resolved my issue! :)