<commit_before>import getRealPath from 'uni-platform/helpers/get-real-path'

function _getServiceAddress () {
  return window.location.protocol + '//' + window.location.host
}

export function getImageInfo ({
  src
}, callbackId) {
  const {
    invokeCallbackHandler: invoke
  } = UniServiceJSBridge
  const img = new Image()
  const realPath = getRealPath(src)
  img.onload = function () {
    invoke(callbackId, {
      errMsg: 'getImageInfo:ok',
      width: img.naturalWidth,
      height: img.naturalHeight,
      path: realPath.indexOf('/') === 0 ? _getServiceAddress() + realPath : realPath
    })
  }
  img.onerror = function (e) {
    invoke(callbackId, {
      errMsg: 'getImageInfo:fail'
    })
  }
  img.src = src
  console.log(img)
}<commit_msg>update: 移除 log<commit_after>import getRealPath from 'uni-platform/helpers/get-real-path'

function _getServiceAddress () {
  return window.location.protocol + '//' + window.location.host
}

export function getImageInfo ({
  src
}, callbackId) {
  const {
    invokeCallbackHandler: invoke
  } = UniServiceJSBridge
  const img = new Image()
  const realPath = getRealPath(src)
  img.onload = function () {
    invoke(callbackId, {
      errMsg: 'getImageInfo:ok',
      width: img.naturalWidth,
      height: img.naturalHeight,
      path: realPath.indexOf('/') === 0 ? _getServiceAddress() + realPath : realPath
    })
  }
  img.onerror = function (e) {
    invoke(callbackId, {
      errMsg: 'getImageInfo:fail'
    })
  }
  img.src = src
}
{'fraction_non_alphanumeric': 0.12933333333333333, 'fraction_numerical': 0.0013333333333333333, 'mean_word_length': 3.325648414985591, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2392209', 'n_tokens_mistral': 492, 'n_tokens_neox': 487, 'n_words': 99}