Skip to content
This repository was archived by the owner on Feb 18, 2021. It is now read-only.

Diff failing on Windows #32

Closed
x3au opened this issue Mar 11, 2016 · 5 comments · Fixed by #34
Closed

Diff failing on Windows #32

x3au opened this issue Mar 11, 2016 · 5 comments · Fixed by #34

Comments

@x3au
Copy link

x3au commented Mar 11, 2016

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.

@twolfson
Copy link
Contributor

Can you explain how you used gm with Graphics Magick? I want to make sure I'm not assuming anything

@x3au
Copy link
Author

x3au commented Mar 11, 2016

Just had to change the line
var gm = require('gm').subClass({imageMagick: true});
to
var gm = require('gm');

Thanks!

@twolfson
Copy link
Contributor

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?

@x3au
Copy link
Author

x3au commented Mar 11, 2016

Sounds good, will do, thanks!

@twolfson
Copy link
Contributor

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"

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

Successfully merging a pull request may close this issue.

2 participants