dry
This commit is contained in:
parent
495fdaf8ec
commit
2393a611a8
@ -25,11 +25,9 @@ assert.imageBufferIsSimilarToFile = function(buffer, referenceImageRelativeFileP
|
|||||||
callback = callback || function(err) { assert.ifError(err); };
|
callback = callback || function(err) { assert.ifError(err); };
|
||||||
|
|
||||||
var referenceImageFilePath = path.resolve(referenceImageRelativeFilePath);
|
var referenceImageFilePath = path.resolve(referenceImageRelativeFilePath);
|
||||||
|
var referenceImageBuffer = fs.readFileSync(referenceImageFilePath, { encoding: null });
|
||||||
|
|
||||||
var testImage = mapnik.Image.fromBytes(Buffer.isBuffer(buffer) ? buffer : new Buffer(buffer, 'binary'));
|
assert.imageBuffersAreSimilar(buffer, referenceImageBuffer, tolerance, callback);
|
||||||
var referenceImage = mapnik.Image.fromBytes(fs.readFileSync(referenceImageFilePath, { encoding: null }));
|
|
||||||
|
|
||||||
imagesAreSimilar(testImage, referenceImage, tolerance, callback);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
assert.imageBuffersAreSimilar = function(bufferA, bufferB, tolerance, callback) {
|
assert.imageBuffersAreSimilar = function(bufferA, bufferB, tolerance, callback) {
|
||||||
|
Loading…
Reference in New Issue
Block a user