forked from aheckmann/gm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
properly handles nested output more getter tests closes aheckmann#20
- Loading branch information
Showing
11 changed files
with
194 additions
and
108 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,10 +1,17 @@ | ||
|
||
// gm - Copyright Aaron Heckmann <[email protected]> (MIT Licensed) | ||
|
||
module.exports = function (gm, dir, finish) { | ||
var assert = require('assert') | ||
|
||
module.exports = function (_, dir, finish, gm) { | ||
|
||
gm(dir + '/blue.gif').color(function (err, color) { | ||
if (err) return finish(err); | ||
|
||
assert.equal(2, color) | ||
assert.equal(this.data.Colors['0'], '( 0, 0,255)\t blue'); | ||
assert.equal(this.data.Colors['1'], '( 0, 0, 0)\t black'); | ||
finish(); | ||
|
||
gm | ||
.color(function gettercolor (err) { | ||
finish(err); | ||
}); | ||
} |
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,10 +1,15 @@ | ||
|
||
// gm - Copyright Aaron Heckmann <[email protected]> (MIT Licensed) | ||
|
||
var assert = require('assert') | ||
|
||
module.exports = function (gm, dir, finish) { | ||
|
||
gm | ||
.depth(function getterdepth (err) { | ||
finish(err); | ||
.depth(function getterdepth (err, depth) { | ||
if (err) return finish(err); | ||
assert.equal(8, depth); | ||
assert.equal('8 bits-per-pixel component', this.data.Depth); | ||
finish(); | ||
}); | ||
} |
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,10 +1,14 @@ | ||
|
||
// gm - Copyright Aaron Heckmann <[email protected]> (MIT Licensed) | ||
|
||
var assert = require('assert') | ||
|
||
module.exports = function (gm, dir, finish) { | ||
|
||
gm | ||
.filesize(function getterfilesize (err) { | ||
finish(err); | ||
.filesize(function getterfilesize (err, size) { | ||
if (err) return finish(err); | ||
assert.ok(size === this.data.Filesize, this.data.filesize) | ||
finish(); | ||
}); | ||
} |
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,10 +1,17 @@ | ||
|
||
// gm - Copyright Aaron Heckmann <[email protected]> (MIT Licensed) | ||
|
||
var assert = require('assert'); | ||
|
||
module.exports = function (gm, dir, finish) { | ||
|
||
gm | ||
.format(function getterformat (err) { | ||
finish(err); | ||
.format(function getterformat (err, format) { | ||
if (err) return finish(err); | ||
|
||
assert.equal(format, 'JPEG'); | ||
assert.equal(this.data.Format, 'JPEG (Joint Photographic Experts Group JFIF format)'); | ||
|
||
finish(); | ||
}); | ||
} |
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,10 +1,27 @@ | ||
|
||
// gm - Copyright Aaron Heckmann <[email protected]> (MIT Licensed) | ||
|
||
module.exports = function (gm, dir, finish) { | ||
var assert = require('assert') | ||
|
||
gm | ||
.identify(function getteridentify (err) { | ||
finish(err); | ||
module.exports = function (_, dir, finish, gm) { | ||
|
||
gm(dir + '/photo.JPG').identify(function (err) { | ||
if (err) return finish(err); | ||
console.error(this.data); | ||
|
||
var d = this.data; | ||
|
||
assert.equal(d.Orientation, 'TopLeft'); | ||
assert.equal(d['JPEG-Quality'], 96); | ||
assert.equal(d['Channel Statistics'].Red['Standard Deviation'], '71.70 (0.2812)'); | ||
|
||
var ex = d['Profile-EXIF']; | ||
assert.equal(ex.Make, 'Apple'); | ||
assert.equal(ex.Model, 'iPad 2'); | ||
assert.equal(ex['GPS Info'], 558); | ||
assert.equal(ex['GPS Longitude'], '80/1,4970/100,0/1'); | ||
assert.equal(ex['GPS Time Stamp'], '15/1,23/1,945/1'); | ||
|
||
finish(); | ||
}); | ||
} |
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,10 +1,14 @@ | ||
|
||
// gm - Copyright Aaron Heckmann <[email protected]> (MIT Licensed) | ||
|
||
var assert = require('assert') | ||
|
||
module.exports = function (gm, dir, finish) { | ||
|
||
gm | ||
.res(function getterres (err) { | ||
finish(err); | ||
.res(function getterres (err, res) { | ||
if (err) return finish(err); | ||
assert.ok(res === this.data.Resolution, this.data.res) | ||
finish(); | ||
}); | ||
} |
Oops, something went wrong.