sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #29676
[Bug 1402048] Re: [1.1.0-nightly] Images with same name but in different tab are wrong
--- first case (same image name in different scripts)
I cannot reproduce this behaviour (at least on OS X 10.10) with the
latest nightly (should not matter though):
# script 1
img = Pattern("test.png").exact()
find(img).highlight(1)
# script 2
img = Pattern("test.png").exact()
find(img).highlight(1)
- both opened in the IDE
- both test.png have different content
- image thumbs show correct content in each script
works as expected for me.
So please more details / concrete example.
--- second case (inline replace of existing image)
this is clear:
In version 1.1.0 we have an image cache, so when using an image again, it is loaded from memory and not again from file.
Since your approach is hidden to SikuliX (I do not check for external changes of the image file), after the replace of the file, the old memory content is still taken.
To avoid this effect, you either have to switch off image caching from the beginning
Settings.setImageCache(0) # is 64 MB otherwise
or say
Image.reset()
after your external replace (which will clear the cache, so caching starts all over again after that)
I am sorry, but I have not yet textually documented all aspects of version 1.1.0 at
http://sikulix-2014.readthedocs.org/en/latest/index.html
... but to get information about classes like Image and their methods you might have a look into the nightly javadocs:
http://nightly.sikuli.de/docs/index.html
For version 1.2, I will revise the Image handling again and will allow,
to replace a cached image with captured content including save to an
image file.
--
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1402048
Title:
[1.1.0-nightly] Images with same name but in different tab are wrong
Status in Sikuli:
Opinion
Bug description:
Using SikuliX 2014 1.1.0 nightly build 2014-12-09 on Windows 8.1 x64
with Java 1.7.0_72.
If you have two test drectories, e.g.:
- test_1.sikuli
- test_2.sikuli
and both tests contains an image with the same name, e.g. "test.png" and 0.99 similarity,
opening both tests with the Sikuli IDE, the image of the first loaded test will dominate in the IDE,
this means the image of the first test will also be shown in the second test tab.
Assume the first test "test_1.sikuli" fails, because it can not match the image on the screen,
running the second loaded test "test_2.sikuli" from the IDE will also fail,
although the image should be found on the screen.
I also noticed another strange behavior which might be affected by the same bug:
capturing and replacing an existing image in the current test won't be found on screen
(assume the image won't be found before capturing).
Here an example code for capturing and replacing an image:
import os, shutil
f = capture(Region(0, 0, 500, 400))
shutil.copy(f, os.path.join(getBundlePath(), 'test.png'))
find(Pattern("test.png").exact())
I hope my description was clear enough.
To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1402048/+subscriptions
References