← Back to team overview

sikuli-driver team mailing list archive

[Bug 1402185] Re: [1.1.0] replacing existing image file with new content on the fly is not recognised (old image still used)

 

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.

** Summary changed:

- [1.1.0] replacing existing image file with new content on the fly is not recognised (old image still used)
+ [1.1.0] replacing existing image file with new content on the fly is not recognised (old image still used) --- workaround

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1402185

Title:
  [1.1.0] replacing existing image file with new content on the fly is
  not recognised (old image still used) --- workaround

Status in Sikuli:
  In Progress

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.join(getBundlePath(), 'test.png'))
  find(Pattern("test.png").exact())

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1402185/+subscriptions


References