-
Notifications
You must be signed in to change notification settings - Fork 358
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
Support screenshot image filenames containing parentheses #250
Conversation
This also seems to fix #202. |
@@ -27,7 +28,8 @@ def percentage(img_size, px_value, info) | |||
end | |||
|
|||
def compare_task(base, compare, output, info) | |||
cmdline = "compare -dissimilarity-threshold 1 -fuzz #{wraith.fuzz} -metric AE -highlight-color blue #{base} #{compare} #{output}" | |||
compare_escaped = Shellwords.escape(compare) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just do compare.shellescape
shellwords needs to be added to the gemspec as a runtime dependency. |
and the pull request needs to be rebased |
459fb0a
to
7464d56
Compare
Escape filenames before passing them to shell execution. The fix is tested most easily with the existing tests with an adjusted filename.
7464d56
to
1c02cb8
Compare
@bootstraponline, thanks for the tip about calling
I changed the commit to call |
oh, sorry didn't know that. The PR looks good to me. 👍 |
/cc @DaveBlooman |
Support screenshot image filenames containing parentheses
I have a website that has a page with parentheses in its URL. When running e.g.
wraith capture
, cropping the page’s screenshots and generating thumbnails fails with errors like these:I solved this by escaping the screenshot filenames before passing them to shell execution. I started writing separate tests for this case too, but in the end I felt it resulted in too much (almost duplicate) test code. So I just test this using the existing tests with an adjusted filename.