Join GitHub today
Support for other image croppers/comparisons? #12
Great work on Hardy! We're looking forward to using it for our visual testing.
One challenge we have is with speed of running the tests. I took a swing at swapping out the PhantomJS based crop+compare functions with one that relies on GraphicsMagick (or ImageMagick). Performance is way faster.
For my tests on OSX, I'm getting about a 7X improvement in speed, at least.
I imagine you might want to keep the PhantomJS testing for some scenarios, though I've noticed that even on Travis ImageMagick is supported.
I'm wondering what approach you would consider for a Pull Request. Direct swap is obviously easiest, but it could probably be configurable.
That is a pretty considerable improvement in speed. Off the top of my head, I'm not sure what the best approach would be. I'd most likely want to keep the PhantomJS tool compatible even if ImageMagick was the default just so there's a fallback for systems without it.
Of course, that shouldn't be hard seeing as they're only a couple of lines each.
In fact, that might be the way to go. Use ImageMagick if it's there and fallback to GhostKnife if not. It's not the simplest development solution but the aim of Hardy is to be as easy as possible for the non-technical user so it should always have a default available. No reason why those who want to can't take advantage of the speed improvements, though.
I'll have a play with the fork and see what the install procedures are like for IM.
(btw, it's super cool that you've looked into this aspect of it, thanks)
Thanks. Yeah, I definitely understand the compatibility urge. It does keep it simple to make it an automatic fallback. One more forward-thinking option would be to make the crop and comparison tool a pluggable API of some sort.
Also, I built an extension (not yet on my branch) that uses GM to create a visual diff of the changes and outputs that file. I'll share that soon, but there's a pull request in GM that needs to get in. ;-)
I started working to make the compare/crop functions pluggable ... https://github.com/dwabyick/Hardy/tree/image_refactor.
Next steps is to add a graphics-magick equivalent, and make that an option from the config file, or possibly a 'try and fallback' approach.
I'm having some difficulty getting graphics-magick to work properly. I had ImageMagick installed in order to use Wraith but I'm getting a lot of dyld errors when I run this fork. I don't think that's anything to do with the fork itself, more likely my machine's setup. I've tried a few times this week but maybe it's just my computer's way of telling me it wants reinstalled from scratch...
I'll try on a different machine this week and reinstall this one. It'll be a good opportunity to try installing everything clean.
Awesome. I'm working right now on a version that will gracefully fallback from gm to ghost knife.
Theoretically gm can work with image magick as well, but I haven't tried that.