mirror of https://gitgud.io/fatchan/gm
parent
710ee0fd2d
commit
3304511c1b
11 changed files with 194 additions and 108 deletions
After Width: | Height: | Size: 59 KiB |
@ -1,10 +1,17 @@ |
||||
|
||||
// gm - Copyright Aaron Heckmann <aaron.heckmann+github@gmail.com> (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); |
||||
}); |
||||
} |
||||
|
@ -1,10 +1,15 @@ |
||||
|
||||
// gm - Copyright Aaron Heckmann <aaron.heckmann+github@gmail.com> (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(); |
||||
}); |
||||
} |
||||
|
@ -1,10 +1,14 @@ |
||||
|
||||
// gm - Copyright Aaron Heckmann <aaron.heckmann+github@gmail.com> (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(); |
||||
}); |
||||
} |
||||
|
@ -1,10 +1,17 @@ |
||||
|
||||
// gm - Copyright Aaron Heckmann <aaron.heckmann+github@gmail.com> (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(); |
||||
}); |
||||
} |
||||
|
@ -1,10 +1,27 @@ |
||||
|
||||
// gm - Copyright Aaron Heckmann <aaron.heckmann+github@gmail.com> (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(); |
||||
}); |
||||
} |
||||
|
@ -1,10 +1,14 @@ |
||||
|
||||
// gm - Copyright Aaron Heckmann <aaron.heckmann+github@gmail.com> (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(); |
||||
}); |
||||
} |
||||
|
@ -1,10 +1,18 @@ |
||||
|
||||
// gm - Copyright Aaron Heckmann <aaron.heckmann+github@gmail.com> (MIT Licensed)
|
||||
|
||||
var assert = require('assert'); |
||||
|
||||
module.exports = function (gm, dir, finish) { |
||||
|
||||
gm |
||||
.size(function gettersize (err) { |
||||
finish(err); |
||||
.size(function gettersize (err, size) { |
||||
if (err) return finish(err); |
||||
|
||||
assert.equal(size.width, 460); |
||||
assert.equal(size.height, 155); |
||||
assert.equal(this.data.Geometry, '460x155'); |
||||
|
||||
finish(); |
||||
}); |
||||
} |
||||
|
Loading…
Reference in new issue