         dst: tmp_resized
         width: format.width
         height: format.height
+      .then (image) ->
+        if minify
+          Compress.compressImage(tmp_resized, tmpDir, extension)
       .then (image) =>
         @sendMetrics 'increment', 'image.resized'
         header = 'x-amz-acl': 'public-read'

    , {concurrency: 2}

  ###*
   * Resizes and uploads a list of images to the bucket
   * Internally calls {@link _resizeAndUploadImage}
   * @param  {Array} images A list of images to be processed
   * @param  {Object} description A config JSON object describing the images conversion
   * @param  {String} [tmpDir] A path to a tmp folder
   * @return {Promise} A promise, fulfilled with a successful response or rejected with an error
  ###
  resizeAndUploadImages: (images, description, tmpDir = '/tmp') ->

    Promise.map images, (image) =>
      name = path.basename(image.Key)

Lynx = require 'lynx'
Promise = require 'bluebird'
easyimage = require 'easyimage'
Compress = require '../compress'
{CustomError} = require '../errors'
fs = Promise.promisifyAll require('fs')

