This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(package): update dependencies https://greenkeeper.io/ * feat(CLI): Adds CLI tool ⌨ - Adds CLI tool to access SSIM - Updates dependencies - Adds babel2016 presets - Adds tests for default parameters - Removes some node build checks. They were slowing down the build (6min) and were overkill. Testing current version of node and 0.12 should be enough to ensure compatibility
- Loading branch information
Oscar
committed
Nov 12, 2016
1 parent
c9b6d3d
commit daac7ee
Showing
21 changed files
with
216 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
"presets": ["es2015", "es2016"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env node | ||
|
||
const yargs = require('yargs'); | ||
const ssim = require('./dist/ssim'); | ||
const { version } = require('./version.js'); | ||
|
||
const argv = yargs | ||
.usage('$0 ssim <img> <img> - Compares 2 images (img can be a URL or a filepath)') | ||
.example('ssim img1.png img2.png') | ||
.example('ssim https://url.jpg https://url2.jpg') | ||
.demand(2) | ||
.help() | ||
.wrap(100) | ||
.version(version) | ||
.argv; | ||
|
||
ssim(argv._[0], argv._[1]) | ||
.then(({ mssim, performance }) => { | ||
process.stdout.write(`SSIM: ${mssim.toPrecision(4)} (${performance}ms)\n`); | ||
}) | ||
.catch((error) => { | ||
process.stdout.write(`Oops something went wrong 😓 ${error.stack}\n`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const test = require('blue-tape'); | ||
const { exec } = require('child_process'); | ||
|
||
test('should be a function', (t) => { | ||
exec('./cli.js ./spec/samples/lena/Q_09372.gif ./spec/samples/lena/color.jpg', | ||
(err, stdout, stderr) => { | ||
t.equal(err, null); | ||
t.equal(stderr, ''); | ||
t.equal(stdout.indexOf('SSIM: 0.3006'), 0, stdout); | ||
t.end(); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.