code: function resizeImage(img, max_width, max_height) {
      var sizes = this.getImageNewAspectSizes(img, max_width, max_height);
      var width = sizes.width;
      var height = sizes.height;
      var canvas = this.imageToCanvas(img, width, height);
      return canvas;
      //return this.getImageByCanvas(canvas);
    }
docs: SECTION: basic Image manipulation returns canvas 
  Resize image
  @param {Image} img
  @param {Number} max_width
  @param {Number} max_height
  @returns {Promise} success(Image), fail(error)