Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path to images with spaces breaks the compare function #25

Closed
DiegoSanchezE opened this issue Mar 1, 2019 · 6 comments
Closed

Path to images with spaces breaks the compare function #25

DiegoSanchezE opened this issue Mar 1, 2019 · 6 comments

Comments

@DiegoSanchezE
Copy link
Contributor

Describe the bug
If the images path contains spaces, the compare function fails.

To Reproduce

  1. Create your robot project at a path that contains spaces, such as G:\My Drive\Web-Automation.
  2. Create a test case that captures an image and then compares it against the baseline sample.

Expected behavior
The error I got was: ValueError: could not convert string to float: b'nabl', but the real issue is that compare is looking for the image in G:\\My which is obviously not equal to G:\My Drive\Web-Automation.

In my particular case, this is the whole error in the robot report:
b"compare: unable to open image 'G:\\My': No such file or directory @ error/blob.c/OpenBlob/3485.\r\ncompare: no decode delegate for this image format `' @ error/constitute.c/ReadImage/556.\r\ncompare: unable to open image 'Drive\\Web-Automation\\visual_images\\actual\\Hillshade\\img1.png': No such file or directory @ error/blob.c/OpenBlob/3485.\r\ncompare: unable to open image 'Drive\\Web-Automation\\visual_images\\actual\\Hillshade\\img1.png': No such file or directory @ error/blob.c/OpenBlob/3485.\r\ncompare: no decode delegate for this image format `' @ error/constitute.c/ReadImage/556.\r\ncompare: unable to open image 'Drive\\Web-Automation\\visual_images\\baseline\\Hillshade\\img1.png': No such file or directory @ error/blob.c/OpenBlob/3485.\r\ncompare: unable to open image 'Drive\\Web-Automation\\visual_images\\baseline\\Hillshade\\img1.png': No such file or directory @ error/blob.c/OpenBlob/3485.\r\ncompare: no decode delegate for this image format `' @ error/constitute.c/ReadImage/556.\r\n"

Notice how it's looking for the G:\\My and Drive\\foo\\bar directories.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: 72.0.3626.119 (Official Build) (64-bit)

Additional context
Imagmagick is installed and in the path
My code works in a different path (no spaces).

The obvious workaround is to not put the images in a path with spaces 😆 , but that's kinda silly.
I'll move my project to another folder, no problem. Just wanted to point this out.
Cheers!

@jessezach
Copy link
Owner

@DiegoSanchezE Will take a look.

@jessezach
Copy link
Owner

@DiegoSanchezE When running the tests do you provide the absolute path to results? Or maybe Imagemagick expands the path.

@jessezach
Copy link
Owner

@DiegoSanchezE I have raised a potential fix. #26
However I did not get the time to test this out. Can you please run you test using this branch and check if it does fix your issue?

@DiegoSanchezE
Copy link
Contributor Author

@jz-jess Definitely. I'll do that in a bit. Thanks!

@DiegoSanchezE
Copy link
Contributor Author

It's working:
image
The comparison happened (and one of the failed). This implies that the library was able to find the images in the same, space-containing path that used to break the compare function.

@jessezach
Copy link
Owner

Fix released in version 0.64. Closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants