"""askemblaex/config.pyRuntime configuration helpers.The set of image extensions recognised by the pipeline can be overridden viathe ``ASKEMBLAEX_IMG_EXTS`` environment variable (comma-separated list,e.g. ``".png,.jpg,.tiff"``)."""from__future__importannotationsimportosDEFAULT_IMG_EXTS={".png",".jpg",".jpeg",".tiff",".tif",}
[docs]defget_img_exts()->set[str]:""" Return the set of image file extensions the pipeline should process. Reads ``ASKEMBLAEX_IMG_EXTS`` from the environment. If unset, returns :data:`DEFAULT_IMG_EXTS`. Extensions are normalised to lowercase and prefixed with a dot if missing. Returns: Set of dot-prefixed lowercase extension strings e.g. ``{".png", ".jpg", ".tiff"}``. """raw=os.getenv("GENIEXTRACT_IMG_EXTS")ifnotraw:returnDEFAULT_IMG_EXTSexts=set()forpartinraw.split(","):part=part.strip().lower()ifnotpart:continueifnotpart.startswith("."):part="."+partexts.add(part)returnexts