function getImageData(imageUrl, rootDir) {
  // check if url is local or remote
  let image
  if (/(http)[s]?:\/\//g.test(imageUrl)) {
    // download image from url
    image = Data.getImageFromRemoteURL(imageUrl)
  } else {
    // remove first slash
    if (imageUrl[0] === '/') imageUrl = imageUrl.substring(1)

    // build full image url by adding the root dir
    imageUrl = NSString.stringWithString(rootDir).stringByAppendingPathComponent(imageUrl)

    // load image from filesystem
    image = Data.getImageFromLocalURL(imageUrl)
  }

  // create image data from NSImage
  return Data.getImageData(image)
}
Gets image data from image url. Image can be remote or local.

@param {String} imageUrl
@param {String} rootDir
@returns {MSImageData}