docs: function resize(img, width=0, height=0, type='png', quality=0.75) {
      let mime
      switch(type.toLowerCase()) {
      case 'jpg':
      case 'jpeg':
      case 'image/jpeg':
          mime = 'image/jpeg'
          break
      case 'png':
      case 'image/png':
      default:
          mime = 'image/png'
      }
      return resizePromise(img, width, height).then(
          canvas => canvas2Blob(canvas, { type: mime, quality })
          //canvas => canvas2DataUrl(canvas, { type: mime, quality })
      )
  }