← Back to team overview

sikuli-driver team mailing list archive

[Bug 1865973] Re: SikuliXception in find function when used with 0 cache and same file name

 

ok, a bug.

thanks for finding.

** Changed in: sikuli
       Status: New => In Progress

** Changed in: sikuli
   Importance: Undecided => High

** Changed in: sikuli
     Assignee: (unassigned) => RaiMan (raimund-hocke)

** Changed in: sikuli
    Milestone: None => 2.0.4

** Changed in: sikuli
       Status: In Progress => Fix Committed

** Changed in: sikuli
   Importance: High => Critical

** Summary changed:

- SikuliXception in find function when used with  0 cache and same file name
+ SikuliXception in find function when used with  0 cache and same file name --- fixed 2.0.4

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

Title:
  SikuliXception in find function when used with  0 cache and same file
  name --- fixed 2.0.4

Status in Sikuli:
  Fix Committed

Bug description:
  Sikuli 2.0.2
  Window 10 , 64 bit - version 1709

  Following is code that I have reduced to reproduce this issue:

  import java.io.File;
  import java.io.IOException;

  import org.python.google.common.io.Files;
  import org.sikuli.basics.Settings;
  import org.sikuli.script.FindFailed;
  import org.sikuli.script.Pattern;
  import org.sikuli.script.Screen;

  public class OtherWay {

  	public static void main(String[] args) throws IOException {
  		Settings.setImageCache(0);
  		try {
  			copyAndSearch("This");
  			copyAndSearch("Sounds");
  			copyAndSearch("Very");
  			copyAndSearch("Title");
  		} catch (FindFailed | IOException e) {
  			// TODO Auto-generated catch block
  			// e.printStackTrace();
  			System.out.println("Exception FindFailed or IOException");
  		}
  	}
  	
  	public static void copyAndSearch(String fileName) throws IOException, FindFailed {
  		Screen r = new Screen(0);
  		File f = new File("C:/temp/" + fileName + ".png");
  		File f2 = new File("C:/temp/tempimage.png");
  		Files.copy(f, f2);
  		Pattern p1 = new Pattern("C:/temp/tempimage.png").similar((float) 0.7);
  		r.find(p1);
  	}
  }

  
  Following is traces:

  Exception in thread "main" org.sikuli.script.SikuliXception: image to search (66, 23) is larger than image to search in (56, 29)
  	at org.sikuli.script.Finder$FindInput2.isValid(Finder.java:1243)
  	at org.sikuli.script.Finder$Finder2.doFind(Finder.java:613)
  	at org.sikuli.script.Finder$Finder2.find(Finder.java:579)
  	at org.sikuli.script.Finder.find(Finder.java:211)
  	at org.sikuli.script.Region.doCheckLastSeenAndCreateFinder(Region.java:2989)
  	at org.sikuli.script.Region.checkLastSeenAndCreateFinder(Region.java:2959)
  	at org.sikuli.script.Region.doFind(Region.java:2906)
  	at org.sikuli.script.Region.find(Region.java:2327)
          ......

  Please note that, image to search on screen (this.png, sounds.png
  etc.) should be visible on screen while running above code.

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


References