blink-diff
Advanced tools
Comparing version 1.0.12 to 1.0.13
CHANGELOG | ||
========= | ||
v1.0.12 - 07/24/15 | ||
* Bugfix for composition to accept false as possible value | ||
v1.0.11 | ||
* Bugfix option loading for issues #27 & #28 | ||
@@ -7,0 +7,0 @@ v1.0.11 - 05/26/15 |
75
index.js
@@ -8,2 +8,6 @@ // Copyright 2014-2015 Yahoo! Inc. | ||
function load(value, defaultValue) { | ||
return (value == null) ? defaultValue : value; | ||
} | ||
/** | ||
@@ -142,23 +146,23 @@ * Blink-diff comparison class | ||
this._imageOutputPath = options.imageOutputPath; | ||
this._imageOutputLimit = options.imageOutputLimit || BlinkDiff.OUTPUT_ALL; | ||
this._imageOutputLimit = load(options.imageOutputLimit, BlinkDiff.OUTPUT_ALL); | ||
// Pixel or Percent | ||
this._thresholdType = options.thresholdType || BlinkDiff.THRESHOLD_PIXEL; | ||
this._thresholdType = load(options.thresholdType, BlinkDiff.THRESHOLD_PIXEL); | ||
// How many pixels different to ignore. | ||
this._threshold = options.threshold || 500; | ||
this._threshold = load(options.threshold, 500); | ||
this._delta = options.delta || 20; | ||
this._delta = load(options.delta, 20); | ||
this._outputMaskRed = options.outputMaskRed || 255; | ||
this._outputMaskGreen = options.outputMaskGreen || 0; | ||
this._outputMaskBlue = options.outputMaskBlue || 0; | ||
this._outputMaskAlpha = options.outputMaskAlpha || 255; | ||
this._outputMaskOpacity = options.outputMaskOpacity || 0.7; | ||
this._outputMaskRed = load(options.outputMaskRed, 255); | ||
this._outputMaskGreen = load(options.outputMaskGreen, 0); | ||
this._outputMaskBlue = load(options.outputMaskBlue, 0); | ||
this._outputMaskAlpha = load(options.outputMaskAlpha, 255); | ||
this._outputMaskOpacity = load(options.outputMaskOpacity, 0.7); | ||
this._outputBackgroundRed = options.outputBackgroundRed || 0; | ||
this._outputBackgroundGreen = options.outputBackgroundGreen || 0; | ||
this._outputBackgroundBlue = options.outputBackgroundBlue || 0; | ||
this._outputBackgroundRed = load(options.outputBackgroundRed, 0); | ||
this._outputBackgroundGreen = load(options.outputBackgroundGreen, 0); | ||
this._outputBackgroundBlue = load(options.outputBackgroundBlue, 0); | ||
this._outputBackgroundAlpha = options.outputBackgroundAlpha; | ||
this._outputBackgroundOpacity = options.outputBackgroundOpacity || 0.6; | ||
this._outputBackgroundOpacity = load(options.outputBackgroundOpacity, 0.6); | ||
@@ -173,10 +177,10 @@ if (options.hideShift) { | ||
} else { | ||
this._outputShiftRed = options.outputShiftRed || 200; | ||
this._outputShiftGreen = options.outputShiftGreen || 100; | ||
this._outputShiftBlue = options.outputShiftBlue || 0; | ||
this._outputShiftAlpha = options.outputShiftAlpha || 255; | ||
this._outputShiftOpacity = options.outputShiftOpacity || 0.7; | ||
this._outputShiftRed = load(options.outputShiftRed, 200); | ||
this._outputShiftGreen = load(options.outputShiftGreen, 100); | ||
this._outputShiftBlue = load(options.outputShiftBlue, 0); | ||
this._outputShiftAlpha = load(options.outputShiftAlpha, 255); | ||
this._outputShiftOpacity = load(options.outputShiftOpacity, 0.7); | ||
} | ||
this._blockOut = options.blockOut || []; | ||
this._blockOut = load(options.blockOut, []); | ||
if (typeof this._blockOut != 'object' && (this._blockOut.length !== undefined)) { | ||
@@ -186,24 +190,21 @@ this._blockOut = [this._blockOut]; | ||
this._blockOutRed = options.blockOutRed || 0; | ||
this._blockOutGreen = options.blockOutGreen || 0; | ||
this._blockOutBlue = options.blockOutBlue || 0; | ||
this._blockOutAlpha = options.blockOutAlpha || 255; | ||
this._blockOutOpacity = options.blockOutOpacity || 1.0; | ||
this._blockOutRed = load(options.blockOutRed, 0); | ||
this._blockOutGreen = load(options.blockOutGreen, 0); | ||
this._blockOutBlue = load(options.blockOutBlue, 0); | ||
this._blockOutAlpha = load(options.blockOutAlpha, 255); | ||
this._blockOutOpacity = load(options.blockOutOpacity, 1.0); | ||
this._copyImageAToOutput = options.copyImageAToOutput || true; | ||
this._copyImageBToOutput = options.copyImageBToOutput || false; | ||
this._copyImageAToOutput = load(options.copyImageAToOutput, true); | ||
this._copyImageBToOutput = load(options.copyImageBToOutput, false); | ||
this._filter = options.filter || []; | ||
this._filter = load(options.filter, []); | ||
this._debug = options.debug || false; | ||
this._debug = load(options.debug, false); | ||
this._composition = options.composition; | ||
if (options.composition === undefined) { | ||
this._composition = true; | ||
} | ||
this._composeLeftToRight = options.composeLeftToRight || false; | ||
this._composeTopToBottom = options.composeTopToBottom || false; | ||
this._composition = load(options.composition, true); | ||
this._composeLeftToRight = load(options.composeLeftToRight, false); | ||
this._composeTopToBottom = load(options.composeTopToBottom, false); | ||
this._hShift = options.hShift || 2; | ||
this._vShift = options.vShift || 2; | ||
this._hShift = load(options.hShift, 2); | ||
this._vShift = load(options.vShift, 2); | ||
@@ -216,3 +217,3 @@ this._cropImageA = options.cropImageA; | ||
this._perceptual = options.perceptual || false; | ||
this._perceptual = load(options.perceptual, false); | ||
@@ -219,0 +220,0 @@ this._gamma = options.gamma; |
{ | ||
"name": "blink-diff", | ||
"version": "1.0.12", | ||
"description": "A lightweight image comparison tool", | ||
"license": "MIT", | ||
"main": "index.js", | ||
"bugs": "https://github.com/yahoo/blink-diff/issues", | ||
"homepage": "https://github.com/yahoo/blink-diff", | ||
"bin": { | ||
"blink-diff": "bin/blink-diff" | ||
}, | ||
"author": { | ||
"name": "Marcel Erz", | ||
"email": "erz@yahoo-inc.com", | ||
"url": "http://www.marcelerz.com" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/yahoo/blink-diff.git" | ||
}, | ||
"keywords": [ | ||
"image-diff", | ||
"visual-diff", | ||
"diff", | ||
"testing", | ||
"blink", | ||
"image", | ||
"difference", | ||
"compare" | ||
], | ||
"scripts": { | ||
"test": "istanbul cover -- _mocha --reporter spec", | ||
"docs": "yuidoc ." | ||
}, | ||
"dependencies": { | ||
"promise": "6.0.0", | ||
"pngjs-image": "~0.11.2" | ||
}, | ||
"devDependencies": { | ||
"chai": "1.9.2", | ||
"coveralls": "2.11.2", | ||
"codeclimate-test-reporter": "0.0.4", | ||
"istanbul": "0.3.2", | ||
"mocha": "1.21.4", | ||
"sinon": "1.12.2", | ||
"sinon-chai": "2.7.0", | ||
"yuidocjs": "0.3.50" | ||
} | ||
"name": "blink-diff", | ||
"version": "1.0.13", | ||
"description": "A lightweight image comparison tool", | ||
"license": "MIT", | ||
"main": "index.js", | ||
"bugs": "https://github.com/yahoo/blink-diff/issues", | ||
"homepage": "https://github.com/yahoo/blink-diff", | ||
"bin": { | ||
"blink-diff": "bin/blink-diff" | ||
}, | ||
"author": { | ||
"name": "Marcel Erz", | ||
"email": "erz@yahoo-inc.com", | ||
"url": "http://www.marcelerz.com" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/yahoo/blink-diff.git" | ||
}, | ||
"keywords": [ | ||
"image-diff", | ||
"visual-diff", | ||
"diff", | ||
"testing", | ||
"blink", | ||
"image", | ||
"difference", | ||
"compare" | ||
], | ||
"scripts": { | ||
"test": "istanbul cover -- _mocha --reporter spec", | ||
"docs": "yuidoc ." | ||
}, | ||
"dependencies": { | ||
"pngjs-image": "~0.11.5", | ||
"preceptor-core": "~0.10.0", | ||
"promise": "6.0.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "1.9.2", | ||
"coveralls": "2.11.2", | ||
"codeclimate-test-reporter": "0.0.4", | ||
"istanbul": "0.3.2", | ||
"mocha": "1.21.4", | ||
"sinon": "1.12.2", | ||
"sinon-chai": "2.7.0", | ||
"yuidocjs": "0.3.50" | ||
} | ||
} |
@@ -163,5 +163,5 @@ Blink-Diff | ||
* ```debug``` When set, then the applied filters will be shown on the output image. (default: false) | ||
* ```createComparison``` Creates a composition of all three images as output (default: true) | ||
* ```compareLeftToRight``` Creates comparison-composition from left to right, otherwise it lets decide the app on what is best | ||
* ```compareTopToBottom``` Creates comparison-composition from top to bottom, otherwise it lets decide the app on what is best | ||
* ```composition``` Creates as output a composition of all three images (approved, highlight, and build) (default: true) | ||
* ```composeLeftToRight``` Creates comparison-composition from left to right, otherwise it lets decide the app on what is best | ||
* ```composeTopToBottom``` Creates comparison-composition from top to bottom, otherwise it lets decide the app on what is best | ||
* ```hShift``` Horizontal shift for possible antialiasing (default: 2) Set to 0 to turn this off. | ||
@@ -293,2 +293,3 @@ * ```vShift``` Vertical shift for possible antialiasing (default: 2) Set to 0 to turn this off. | ||
* [azu](https://github.com/azu) | ||
* [bradex](https://github.com/bradex) | ||
@@ -295,0 +296,0 @@ ##Third-party libraries |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
599809
43
5854
317
3
1
2
+ Addedpreceptor-core@~0.10.0
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddate-format@0.0.0(transitive)
+ Addeddebug@0.7.42.6.9(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedlog4js@1.1.1(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedms@2.0.0(transitive)
+ Addedpreceptor-core@0.10.1(transitive)
+ Addedreadable-stream@1.1.14(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedstreamroller@0.4.1(transitive)
+ Addedstring_decoder@0.10.31(transitive)
Updatedpngjs-image@~0.11.5