Diff failing on Windows
On Windows 7 and Windows server 2012, the code didn't work as expected. Even when two completely different files were passed, the diff returned success. On digging further, noticed that the crop function called on gm always produced a one by one pixel file. this.crop(params.toWidth, params.toHeight, 0, 0);
After using gm without imagemagick, (so using graphicsmagick instead) the code succeeded.
Any ideas about this?
If we have the option to use imagemagick or graphicsmagick from this module, that will solve the problem.
Can you explain how you used gm with Graphics Magick? I want to make sure I'm not assuming anything
Just had to change the line var gm = require('gm').subClass({imageMagick: true}); to var gm = require('gm');
Thanks!
Cool, thought so but wanted to make sure it wasn't you running gm compare on the CLI =P
I think adding an option for disabling ImageMagick sounds reasonable. Let's go with the name imageMagick for consistency with gm (we can make it default to true for backwards compatibility).
imageDiff({imageMagick: false, actualImage, ...})
Would you be interested in writing a PR for this?
Sounds good, will do, thanks!
After getting the problematic images, we were able to track down the source of the problem and open a PR that seems to patch the issue. More specific details can be found on the PR itself
#34
If you would like to try out the PR locally, then it can be installed via a git URL via npm:
https://docs.npmjs.com/files/package.json#git-urls-as-dependencies
"image-diff": "git://github.com/twolfson/image-diff#ef3aa9f"