Skip to content
Browse files

Logging errors

  • Loading branch information...
1 parent c3d8c55 commit 692acaee49a074bb2c1027c865721ba5f15327f4 @rc1 rc1 committed Jul 25, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/colour-extractor.coffee
View
2 src/colour-extractor.coffee
@@ -10,13 +10,15 @@ exports.topColours = (sourceFilename, sorted, cb) ->
img = gm(sourceFilename)
tmpFilename = temp.path({suffix: '.miff'})
img.size((err, wh) ->
+ console.log err if err
ratio = wh.width/MAX_W
w2 = wh.width/2
h2 = wh.height/2
img.bitdepth(8) # Initial colour reduction, prob. smarter than our 'algorithm'
.crop(w2, h2, w2/2, w2/2) # Center should be the most interesting
.scale(Math.ceil(wh.height/ratio), MAX_W) # Scales the image, histogram generation can take some time
.write('histogram:' + tmpFilename, (err) ->
+ console.log err if err
histogram = ''
miffRS = fs.createReadStream(tmpFilename, {encoding: 'utf8'})

0 comments on commit 692acae

Please sign in to comment.
Something went wrong with that request. Please try again.