Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
Published v1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Erz committed Dec 6, 2014
1 parent 35d99d6 commit 88113ae
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Changelog
=========

v1.0.5 - 12/05/14
v1.0.6 - 12/05/14
* Bugfix: Using image as default instead of string when loading image

v1.0.4 - 11/28/14
Expand Down
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,12 +505,15 @@ BlinkDiff.prototype = {
* @private
*/
_loadImage: function (path, image) {
if (image instanceof PNGImage) {
return image;
} else if (image instanceof Buffer) {

if (image instanceof Buffer) {
return Promise.denodeify(PNGImage.loadImage)(image);
} else {

} else if ((typeof path === 'string') && !image) {
return Promise.denodeify(PNGImage.readImage)(path);

} else {
return image;
}
},

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blink-diff",
"version": "1.0.5",
"version": "1.0.6",
"description": "A lightweight image comparison tool",
"license": "MIT",
"main": "index.js",
Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ describe('Blink-Diff', function () {
this.image = generateImage('medium-2');
});

describe('from Path', function () {
describe('from Image', function () {

it('should use already loaded image', function () {
var result = this.instance._loadImage("pathToFile", this.image);
Expand All @@ -274,7 +274,7 @@ describe('Blink-Diff', function () {
});
});

describe('from Image', function () {
describe('from Path', function () {

it('should load image when only path given', function (done) {
var result = this.instance._loadImage(__dirname + '/test2.png');
Expand Down

0 comments on commit 88113ae

Please sign in to comment.