Mac: Retina display: Exists not consistent with copied images

Asked by Jeff_Vallis on 2019-12-25

2.0.1-2019-11-22_16:54/Mac10.15.2/Java13(64)13.0.1+9
having trouble with exists not finding external image with absolute path
So I thought that there must be something wrong with the image

did exists using a screen shot in the ide
and exists worked ok
in finder - show package contents - copied image - saved image to my image directory - /Users/Jeff/Documents/Sikuli_Live/SikuliScripts/Vikings/Code/Data/Images_Mac/Ruler.png
added another exists with the path above of the copied image - not working
Code:
if 1 == 1:
    setRect(8,102,1400,915)
    v_Image = "/Users/Jeff/Documents/Sikuli_Live/SikuliScripts/Vikings/Code/Data/Images_Mac/Ruler.png"
    print "^ " * 40
    print exists(v_Image)
    v_Image = "1577259194316.png" # this is the embedded image
    print exists(v_Image)
    print "= " * 40
    exit(0)

output :-
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
None
M[1350,551 55x39]@S(0) S:0.77 C:1377,570 [188 msec]
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2019-12-26
Last reply:
2019-12-27
Jeff_Vallis (vallis-pj) said : #1

More info:
There is something going on that I cant work out and I dont think that it is Sikuli

IDE
v_Image = IDE Screen Shot
Finder Show Package Contents
copy the image
paste to my saved images
v_Image2 = the above saved image location

exists(v_Image) - OK
exists(v_Image2) - fails

used find(v_Image) to get coords x,y,h,w and used img = capture(some_region) to get and save an image to my saved image location
v_image3 = the above capture
exists(v_Image3) - works ok

so in terminal
copied v_Image3 to v_Image2
exists(v_Image2) - still fails

so it appears that the Imac is some how preventing to image from matching or Imac Copy is doing something to the Image.

Any help would be useful otherwise if you think that its not a Sikuli problem Just Close this Question

RaiMan (raimund-hocke) said : #2

if the image "/Users/Jeff/Documents/Sikuli_Live/SikuliScripts/Vikings/Code/Data/Images_Mac/Ruler.png" is captured with the Mac capture tool and you are on a Retina display:
https://answers.launchpad.net/sikuli/+question/687424

If this is not the case, send me the 2 images and a screenshot
sikulix---at---outlook---dot---com

RaiMan (raimund-hocke) said : #3

@Jeff's answer in wrong question ;-)
1.I am on a Retina Display
2.Image Captured by Sikuli - is OK
3.copy of Image Captured by Sikuli - is not OK

sounds like its not just the IMac Capture Tool - Copy changes image as well

if you agree please mark solved

RaiMan (raimund-hocke) said : #4

surely not solved.

How do you do the copy ?

Jeff_Vallis (vallis-pj) said : #5

Both
Once in finder
Then terminal cp

On Thu, 26 Dec 2019 at 10:47, RaiMan <email address hidden>
wrote:

> Your question #687520 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/687520
>
> RaiMan requested more information:
> surely not solved.
>
> How do you do the copy ?
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/sikuli/+question/687520
>
> You received this question notification because you asked the question.
>

RaiMan (raimund-hocke) said : #6

I made this test on my MacBook Pro Retina macOS 10.15.2:

# where the image copies are stored
copiedImages = "/Users/raimundhocke/IdeaProjects/_SUPPORT/macImg/"

print "*** original (IDE capture button)"
find("img.png").highlight(1)

print "*** internally copied with saveAs"
find(copiedImages + "imgSxCpy").highlight(1)

print "*** copied in Finder: context menu copy & paste"
find(copiedImages + "imgCpy").highlight(1)

print "*** copied in Finder: keys copy & paste"
find(copiedImages + "imgCpPa").highlight(1)

print "Preview: Duplicate + Save"
find( copiedImages + "imgCopy").highlight(1)

With the following message log:
*** original
[log] highlight M[254,62 160x28]On(0) S 10000 for 1.0 secs
*** internally copied with saveAs
[log] highlight M[254,62 160x28]On(0) S 10000 for 1.0 secs
*** copied in Finder: context menu copy & paste
[log] highlight M[254,62 160x28]On(0) S 10000 for 1.0 secs
*** copied in Finder: keys copy & paste
[log] highlight M[254,62 160x28]On(0) S 10000 for 1.0 secs
Preview: Duplicate + Save
[log] highlight M[254,62 160x28]On(0) S 10000 for 1.0 secs

which proves, that all image variants are found with match score 100% - hence all images have exactly the same pixels

be aware: for the images stored outside the script I left out the .png ending to avoid the error messages on script load about not found images on imagepath.

Can you help with this problem?

Provide an answer of your own, or ask Jeff_Vallis for more information if necessary.

To post a message you must log in.