// Dependencies
var path = require('path'),
  imagePath = '/tmp/';

module.exports = {
  // Send POST response
  postRes: function(req, res, key) {
    res.set('Content-Type', 'image/jpeg');
    res.status(201);
    res.json({id:key});
  },

  // Send error response
  errRes: function(req, res, statusCode, body) {
    statusCode = statusCode || 404;
    body = body || 'image not found';
    res.status(statusCode);
    res.send(body);
  },

  // Send GET response
  getRes: function(req, res, key) {
    res.set({'Content-Type': 'image/jpeg'});
    res.status(200);
    res.sendfile(imagePath + key + '.jpg');
  },

  // Send DELETE response
  delRes: function(req, res, key) {
    res.status(204);
    res.json({id:key});
  },

  // Send JSON with metadata for requested image
  metaData: function(req, res, key, w, h, statusCode) {
    var response = {};

    response.id = key;
    response.bucket = process.env.AWS_BUCKET;
    response.url = '/' + key;
    response.createdAt = new Date();
    response.width = w;
    response.height = h;

    res.status(statusCode);
    res.json(response);
  }
};
@@ -814,12 +814,16 @@
 ey, 
-w, h
+features
 , st
@@ -948,16 +948,27 @@
 url = '/
+babyanimals
 ' + key;
@@ -1026,17 +1026,30 @@
 width = 
-w
+features.width
 ;%0A    re
@@ -1064,17 +1064,113 @@
 eight = 
-h
+features.height;%0A    response.filesize = features.filesize;%0A    response.format = features.format
 ;%0A%0A    r

add filesize and image formate to json response