mirror of https://gitgud.io/fatchan/gm
parent
b5c7fd8b23
commit
9fa564ea59
4 changed files with 41 additions and 2 deletions
After Width: | Height: | Size: 40 KiB |
@ -0,0 +1,22 @@ |
||||
var assert = require('assert'); |
||||
var fs = require('fs'); |
||||
|
||||
module.exports = function (gm, dir, finish, GM) { |
||||
GM.compare(dir + '/original.jpg', dir + '/original.png', function(err, same) { |
||||
if (err || !same) finish(err); |
||||
else outputDiff(); |
||||
}); |
||||
|
||||
function outputDiff() { |
||||
var options = { |
||||
highlightColor: 'yellow', |
||||
file: dir + '/diff.png' |
||||
}; |
||||
GM.compare(dir + '/original.jpg', dir + '/noise1.png', options, function(err) { |
||||
if (err) return finish(err); |
||||
fs.exists(options.file, function(exists) { |
||||
finish(!exists); |
||||
}); |
||||
}); |
||||
} |
||||
}; |
Loading…
Reference in new issue