(Of course, as it is for all stylistic considerations, it's a matter of taste, not absolutes.)
fs.readdir source, (err, files) ->
if err
console.log 'Error finding files: ' + err
else
files.forEach (filename, fileIndex) ->
console.log filename
gm(source + filename).size (err, values) ->
if err
console.log 'Error identifying file size: ' + err
else
console.log filename + ' : ' + values
aspect = values.width / values.height
widths
.forEach ((width, widthIndex) ->
height = Math.round(width / aspect)
console.log "resizing #{filename} to #{height}x#{height}"
this.resize width, height
.write "#{dest}w#{width}_#{filename}", (err) ->
if err then console.log 'Error writing file: ' + err
).bind this