code: function(file) {
  
    // avoid generated thumbnails being processed
    let isThumbnail = _.some(options.profiles, function(profile, profileName) {
      return new RegExp('^' + profileName + '-').test(path.basename(file.path))
    })
    if (isThumbnail) {
      return vow.resolve()
    }
  
    return vow.all(
      // apply all options.profiles to each file
      _.map(options.profiles, function(profile, profileName) {
        let writeOp = vow.defer()
        let sourcePath = path.join(
          hexo.source_dir,
          file.path
        )
  
        // notice the destination is still the source folder
        // it's best to have hexo transfer the file to public otherwise bad things
        // will happen
        let destPath = path.join(
          hexo.source_dir,
          path.dirname(file.path),
          profileName + '-' + path.basename(file.path)
        )
        // create gm instance
        let image = gm(sourcePath)
  
        // apply methods listed in the profile to gm instance
        _.each(profile, function(args, method) {
          image[method].apply(image, args)
        })
  
        // write created image
        image.write(destPath, function(err) {
          if (err) {
            console.log(err)
            throw err
          }
          // getting a little hacky here, `hexo.source` is an instance of
          // Box https://git.io/vww9o _processFile is a private method, so it's
          // probably a little naughty to use this in a plugin
          hexo.source._processFile(hexo.source.File.TYPE_CREATE, destPath)
          .then(function() {
            writeOp.resolve()
          })
        })
        return writeOp
      })
    )
  }
docs: ## processor
  a hexo processor is called for each file in `source_dir` which matches the
  mask for that processor.
  in this case, a processor is created for each mask listed in options, so for
  each file matching any of those masks we create a thumbnail for each profile
  
  see:
  https://hexo.io/api/processor.html
  https://hexo.io/api/box.html
  
  @param {File} file hexo File instance
  @return Promise