add_image_format = (mime_type, name_and_exts, target_array = image_formats) => {
	// Note: some localizations have commas instead of semicolons to separate file extensions
	// Assumption: file extensions are never localized
	const format = {
		formatID: mime_type,
		mimeType: mime_type,
		name: localize(name_and_exts).replace(/\s+\([^(]+$/, ""),
		nameWithExtensions: localize(name_and_exts),
		extensions: [],
	};
	const ext_regexp = /\*\.([^);,]+)/g;
	if (get_direction() === "rtl") {
		const rlm = "\u200F";
		const lrm = "\u200E";
		format.nameWithExtensions = format.nameWithExtensions.replace(ext_regexp, `${rlm}*.${lrm}$1${rlm}`);
	}
	let match;
	// eslint-disable-next-line no-cond-assign
	while (match = ext_regexp.exec(name_and_exts)) {
		const ext = match[1];
		// ext_to_image_formats[ext] = ext_to_image_formats[ext] || [];
		// ext_to_image_formats[ext].push(format);
		// mime_type_to_image_formats[mime_type] = mime_type_to_image_formats[mime_type] || [];
		// mime_type_to_image_formats[mime_type].push(format);
		format.extensions.push(ext);
	}

	target_array.push(format);
}
@param {string} mime_type
@param {string} name_and_exts
@param {ImageFileFormat[]} [target_array]