[1.1.0-Beta1] IDE wont load script with an image from a addImagePath() or with a not existing image --- fixed with Beta2

Bug #1318074 reported by Barry Janzen
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SikuliX
Fix Committed
Critical
RaiMan

Bug Description

Worse yet, commenting out this image in the script didn't work either.

Mac Mavericks 10.9.2, Java 7, SikuliX 1.1.0

Steps to repo:

1. Create an image in a folder to be loaded, e.g. /var/tmp/images/foo.png
2. Create a script /Users/me/bar.sikuli/bar.py that loads that image as so:

addImagePath('/var/tmp/images')
click('foo.png')

3. Save and open the script in the IDE:
Expected: script to open
Got:
[error] Image: could not be loaded from /var/tmp/images/foo..png
[error] Can't load file /Users/me/bar.sikuli/ --- check available runners!

Open the same file in 1.0.1. It works.

Revision history for this message
RaiMan (raimund-hocke) wrote :

confirmed. thanks for finding.

… but this is a general problem with not existing images

The problem can be reproduced with a simple one-liner.
"foo.png"

the script can be saved, but the IDE does not get back to a normal state.
when trying to open, the script is not loaded into the editor tab.

I will check and fix it as soon as possible.

summary: - Regression: 1.1.0 IDE wont load script with an image from a
- addImagePath()
+ [1.1.0-Beta1] IDE wont load script with an image from a addImagePath()
+ or with a not existing image
Changed in sikuli:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
status: In Progress → Confirmed
Revision history for this message
Barry Janzen (barry-janzen) wrote : Re: [Bug 1318074] Re: Regression: 1.1.0 IDE wont load script with an image from a addImagePath()

Possibly another, one that works in 1.0.1 but not in 1.1.0:

In https://answers.launchpad.net/sikuli/+question/139475 I wrote:

@RaiMan, this broke in 1.1.0? I've had issues with finding text on screen,

m = r.exists("534438",0)

because it's looking for 534438.png, not the text. I built with Tesseract,
and have preferences set to do OCR, but still nothing. (Mavericks, Java 7,
Sikuli 1.1.0). Bug?

On Fri, May 9, 2014 at 4:38 PM, RaiMan <email address hidden> wrote:

> confirmed. thanks for finding.
>
> … but this is a general problem with not existing images
>
> The problem can be reproduced with a simple one-liner.
> "foo.png"
>
> the script can be saved, but the IDE does not get back to a normal state.
> when trying to open, the script is not loaded into the editor tab.
>
> I will check and fix it as soon as possible.
>
> ** Summary changed:
>
> - Regression: 1.1.0 IDE wont load script with an image from a
> addImagePath()
> + [1.1.0-Beta1] IDE wont load script with an image from a addImagePath()
> or with a not existing image
>
> ** Changed in: sikuli
> Status: New => In Progress
>
> ** Changed in: sikuli
> Importance: Undecided => Critical
>
> ** Changed in: sikuli
> Assignee: (unassigned) => RaiMan (raimund-hocke)
>
> ** Changed in: sikuli
> Milestone: None => 1.1.0
>
> ** Changed in: sikuli
> Status: In Progress => Confirmed
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1318074
>
> Title:
> [1.1.0-Beta1] IDE wont load script with an image from a addImagePath()
> or with a not existing image
>
> Status in Sikuli:
> Confirmed
>
> Bug description:
> Worse yet, commenting out this image in the script didn't work either.
>
> Mac Mavericks 10.9.2, Java 7, SikuliX 1.1.0
>
> Steps to repo:
>
> 1. Create an image in a folder to be loaded, e.g.
> /var/tmp/images/foo.png
> 2. Create a script /Users/me/bar.sikuli/bar.py that loads that image as
> so:
>
> addImagePath('/var/tmp/images')
> click('foo.png')
>
> 3. Save and open the script in the IDE:
> Expected: script to open
> Got:
> [error] Image: could not be loaded from /var/tmp/images/foo..png
> [error] Can't load file /Users/me/bar.sikuli/ --- check available
> runners!
>
> Open the same file in 1.0.1. It works.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/sikuli/+bug/1318074/+subscriptions
>

Revision history for this message
RaiMan (raimund-hocke) wrote : Re: [1.1.0-Beta1] IDE wont load script with an image from a addImagePath() or with a not existing image

before really making this a bug:
to be able to use
m = r.exists("534438",0)

on has to switch on TextSearch (Settings.OcrTextSearch=true;)

I just tested: works.

Revision history for this message
Barry Janzen (barry-janzen) wrote :

In Java perhaps. But I was running from UI this exact code in Jython:

App.open('Google Chrome')
wait(2)
Settings.OcrTextSearch = True
r = selectRegion()
m = r.exists("534438" ,0)

# Chrome had the url http://qoydkw.bay.livefilestore.com/y1pSr0oDju9ndvMzJJfo_qWD2qEvMdDDwoKquMNWWkUYAxgrsVcXmETY8yW_LqIieOKXgwlTt8yxe8eQDY-SCySCFljo59mSSIC/TextOnTheScreen.png?psid=1 listed in that question.
And I still get
[error] Image: could not be loaded from /Users/blah-blah/L10N-test.sikuli/534438.png

over and over. It does this whether from cmd line or IDE.

Revision history for this message
Barry Janzen (barry-janzen) wrote :

Tried one more instance: running interactively from the cmd line via "./runsikuli -i" and typing in the lines. Guess what? It works in interactive mode!

Revision history for this message
Barry Janzen (barry-janzen) wrote :

I tried this today on Win 7. After failing install with 32-bit Java, I installed 64-bit, ran Sikuli, and set both Settings.OcrTextSearch and OcrTextRead to True.

I was able to read text from a region, but when I tried
x.exists('63')
or
click('63')
It failed in the same manner as Mac. exists will continue to keep trying to load '63.png', while click gave me an
[error] FindFailed ( Attempt to dereference null cv::Mat )

Revision history for this message
Barry Janzen (barry-janzen) wrote :

I searched further on this, and found https://answers.launchpad.net/sikuli/+faq/2436 (removing lib and tessdata folders) which did not change any of this behavior. Raiman, any more things to try, or any ideas what's causing this?

Revision history for this message
RaiMan (raimund-hocke) wrote :

Sorry, not yet checked this.

Since it is another question as comment beneath something else, it vanished from my desk ;-)

after having tried the new build of Beta1, you should post a bug on that.

Revision history for this message
Barry Janzen (barry-janzen) wrote : Re: [Bug 1318074] Re: [1.1.0-Beta1] IDE wont load script with an image from a addImagePath() or with a not existing image

I installed Beta 1 with ALL packages, still failed. Here's the exact
script and exact output I get.
# Setup: Put the text 'BR549' in a TextEdit document
App.open('TextEdit')
wait(2)
Settings.OcrTextSearch = True
Settings.OcrTextRead = True
print Settings.OcrTextSearch
print Settings.OcrTextRead
print Settings.JavaVersion
print Settings.JREVersion
# select a region of text around BR549 to make sure it's not anything with
matching
r = selectRegion()
print r.text() # this works, we can read text from the screen
m = r.exists('BR549')

Output:
True
True
7
1.7.0_55-b13

BR549
[error] Image: could not be loaded from
/Users/bjanzen/Python/Sikuli/L10N-test.sikuli/BR549.png
over and over...

We're also seeing another bug on multiple machines: we're unable to grab /
find images in menus and window toolbars on Mac. I'll explore more and
file a bug. We're probably limited to going back to 1.0.1 for now.

On Tue, May 20, 2014 at 10:16 AM, RaiMan <email address hidden> wrote:

> Sorry, not yet checked this.
>
> Since it is another question as comment beneath something else, it
> vanished from my desk ;-)
>
> after having tried the new build of Beta1, you should post a bug on
> that.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1318074
>
> Title:
> [1.1.0-Beta1] IDE wont load script with an image from a addImagePath()
> or with a not existing image
>
> Status in Sikuli:
> Confirmed
>
> Bug description:
> Worse yet, commenting out this image in the script didn't work either.
>
> Mac Mavericks 10.9.2, Java 7, SikuliX 1.1.0
>
> Steps to repo:
>
> 1. Create an image in a folder to be loaded, e.g.
> /var/tmp/images/foo.png
> 2. Create a script /Users/me/bar.sikuli/bar.py that loads that image as
> so:
>
> addImagePath('/var/tmp/images')
> click('foo.png')
>
> 3. Save and open the script in the IDE:
> Expected: script to open
> Got:
> [error] Image: could not be loaded from /var/tmp/images/foo..png
> [error] Can't load file /Users/me/bar.sikuli/ --- check available
> runners!
>
> Open the same file in 1.0.1. It works.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/sikuli/+bug/1318074/+subscriptions
>

RaiMan (raimund-hocke)
Changed in sikuli:
status: Confirmed → Fix Committed
summary: [1.1.0-Beta1] IDE wont load script with an image from a addImagePath()
- or with a not existing image
+ or with a not existing image --- fixed with Beta2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.