[1.1.0-Beta3] IDE: using click(../images/myimage.png) leads to not found images on reload of script

Bug #1335398 reported by Rajesh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Fix Committed
Critical
RaiMan

Bug Description

should work now with 1.1.0 (2014-09-17+)

-----------------------------------------

I have a folder structure as below

|-images
   |-image1.png
   |-image2.png

|-templates
   |-template1.sikuli (only has .py and .html)
   |-template2.sikuli (only has .py and .html)

Issue #1 : If i refer the image1.png from my template1.sikuli script as click("../images/image1.png") then it works first time but after saving the scripts does not work, i get error saying image not found in template1.sikuli directory

Issue #2 : If i make any modification to my template1.sikuli , then the image relative reference gets overwritten as click("image1.png")

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

.. in filenames are officially not supported generally.

That it works in your case is interesting though. I will check that.

please report complete Sikuli version info (see File -> About) and what system.

to work around this problem, you might either use the ImagePath features or use a variable having:
iDir = "../images/"

and use
click(iDir + "image1.png")

to avoid these internal changes of your script code.

Changed in sikuli:
status: New → In Progress
status: In Progress → Fix Committed
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
summary: - [IDE 1.1.0] Sikuli script does not load images for relative image
- reference like click(../images/myimage.png)
+ [1.1.0-BetaX] IDE: click(../images/myimage.png) leads to not found
+ images on reload of script
summary: - [1.1.0-BetaX] IDE: click(../images/myimage.png) leads to not found
+ [1.1.0-BetaX] IDE: using click(../images/myimage.png) leads to not found
images on reload of script
Revision history for this message
Rajesh (rajesh-thekkadath) wrote : Re: [1.1.0-BetaX] IDE: using click(../images/myimage.png) leads to not found images on reload of script

1.1.0 Beta3 in Mac 10.9.3

Using the below command also solves the problem

imagePath=os.path.join(os.path.dirname(getBundlePath()), "../images/")
addImagePath(imagePath)

RaiMan (raimund-hocke)
summary: - [1.1.0-BetaX] IDE: using click(../images/myimage.png) leads to not found
+ [1.1.0-Beta3] IDE: using click(../images/myimage.png) leads to not found
images on reload of script
RaiMan (raimund-hocke)
Changed in sikuli:
importance: High → Critical
description: updated
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.