[check] replacing existing image file with new content on the fly is not recognised (old image still used) --- workaround
Bug #1402185 reported by
RaiMan
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
In Progress
|
Medium
|
RaiMan |
Bug Description
**** workaround see comment #1
--- from bug 1402048
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.
find(Pattern(
summary: |
- [1.1.0] replacing existing image file with new content on the fly is not + [check] replacing existing image file with new content on the fly is not recognised (old image still used) --- workaround |
Changed in sikuli: | |
milestone: | 2.0.0 → 2.0.1 |
To post a comment you must log in.
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 setImageCache( 0) # is 64 MB otherwise
Settings.
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 sikulix- 2014.readthedoc s.org/en/ latest/ index.html
http://
... but to get information about classes like Image and their methods you might have a look into the nightly javadocs: nightly. sikuli. de/docs/ index.html
http://
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.