Browse files

zeug

  • Loading branch information...
1 parent d8e926d commit d14f38ade0fc3f1d105626049baa77aa4e92dbb2 @netroy netroy committed Oct 11, 2013
Showing with 5 additions and 3 deletions.
  1. +2 −1 bin/image-size
  2. +1 −0 lib/index.js
  3. +2 −2 specs/all.spec.js
View
3 bin/image-size
@@ -12,6 +12,7 @@ if (!files.length) {
process.exit(-1);
}
+var red = ['\x1B[31m', '\x1B[39m'];
var bold = ['\x1B[1m', '\x1B[22m'];
var grey = ['\x1B[90m', '\x1B[39m'];
var green = ['\x1B[32m', '\x1B[39m'];
@@ -29,6 +30,6 @@ files.forEach(function (image) {
}
} catch (e) {
// console.error(e.stack);
- console.error(e.message, '-', image);
+ console.error(red[0] + e.message + red[1], '-', image);
}
});
View
1 lib/index.js
@@ -18,6 +18,7 @@ var bufferSize = 64*1024;
function lookup (buffer, filepath) {
// detect the file type.. don't rely on the extension
var type = detector(buffer, filepath);
+
// find an appropriate handler for this file type
if (type in handlers) {
return handlers[type](buffer, filepath);
View
4 specs/all.spec.js
@@ -19,11 +19,11 @@ var sizes = {
'width': 123,
'height': 456
},
- 'specs/images/valid/large.jpg': {
+ 'specs/images/valid/jpg/large.jpg': {
'width': 1600,
'height': 1200
},
- 'specs/images/valid/very-large.jpg': {
+ 'specs/images/valid/jpg/very-large.jpg': {
'width': 4800,
'height': 3600
}

0 comments on commit d14f38a

Please sign in to comment.