Closed mbertheau closed 9 years ago
Thank you for the review!
Thanks a lot for this. I'd love to add Imagemagick support. It'd be easier if we had test though. Do you think you could add some as part of this PR?
I realize that the perceptualdiff backend doesn't have tests either. We should add some too, but that's of course outside the scope of this PR.
Sorry, I'm not using this anymore. Feel free to close.
No worries. Leaving this ticket open as it's a useful feature I hope can be merged at some point. Hopefully some tests can be added.
@mbertheau So I have written some tests for this and could merge it soon. However, I first wanted to ask you, what is the purpose of the cmp_cmd
command? Isn't compare_cmd
all that needs to be executed? Thanks!
@jphalip I believe cmp
was much faster at recognizing files that are the same than compare
. For that reason I first tried cmp
, and when the files were equal, I could return that result quickly. If they weren't the same, I used compare to get a difference metric.
@mbertheau Ok, I see. Is cpm
supposed to be part of Imagemagick itself? I've installed Imagemagick via brew install
on my Mac, but that seems to only give me compare
, not cmp
.
cmp
is part of diffutils
on Ubuntu. I don't know about OS X, sorry :)
@mbertheau Ok, I see, thank you :) I don't think we can assume that all users will have cmp
available, so we should probably leave that out. I'll try to push the feature with tests soon.
I find the diffs imagemagick produces much easier to work with.
See http://stackoverflow.com/questions/5132749/imagemagick-diff-an-image for examples.
This engine behaves a bit differently than the perceptualdiff engine. It leaves the new screenshot around only if there are differences. When there's no differences, an existing differences image from an earlier run is deleted. It also uses cmp at first to quickly skip unchanged screenshots.