function parseImageProperties(style, builder, uniforms, prefix, textureId) {
  const image = new Image();
  image.crossOrigin =
    style[`${prefix}cross-origin`] === undefined
      ? 'anonymous'
      : style[`${prefix}cross-origin`];
  assert(
    typeof style[`${prefix}src`] === 'string',
    `WebGL layers do not support expressions for the ${prefix}src style property`,
  );
  image.src = /** @type {string} */ (style[`${prefix}src`]);

  // the size is provided asynchronously using a uniform
  uniforms[`u_texture${textureId}_size`] = () => {
    return image.complete ? [image.width, image.height] : [0, 0];
  };
  builder.addUniform(`u_texture${textureId}_size`, 'vec2');
  const size = `u_texture${textureId}_size`;

  uniforms[`u_texture${textureId}`] = image;
  builder.addUniform(`u_texture${textureId}`, 'sampler2D');
  return size;
}
This will parse an image property provided by `<prefix>-src`
The image size expression in GLSL will be returned
@param {import("../../style/flat.js").FlatStyle} style Style
@param {ShaderBuilder} builder Shader builder
@param {Object<string,import("../../webgl/Helper").UniformValue>} uniforms Uniforms
@param {'icon-'|'fill-pattern-'|'stroke-pattern-'} prefix Property prefix
@param {string} textureId A identifier that will be used in the generated uniforms: `sample2d u_texture<id>` and `vec2 u_texture<id>_size`
@return {string} The image size expression