diff --git a/large_image/constants.py b/large_image/constants.py index fd841bea8..dbe6755fc 100644 --- a/large_image/constants.py +++ b/large_image/constants.py @@ -27,9 +27,10 @@ class SourcePriority(enum.IntEnum): LOWER = 6 IMPLICIT_HIGH = 7 IMPLICIT = 8 - FALLBACK_HIGH = 9 - FALLBACK = 10 - MANUAL = 11 # This and higher values will never be selected automatically + IMPLICIT_LOW = 9 + FALLBACK_HIGH = 10 + FALLBACK = 11 + MANUAL = 12 # This and higher values will never be selected automatically TILE_FORMAT_IMAGE = 'image' diff --git a/sources/bioformats/large_image_source_bioformats/__init__.py b/sources/bioformats/large_image_source_bioformats/__init__.py index a23850f76..40f504b6b 100644 --- a/sources/bioformats/large_image_source_bioformats/__init__.py +++ b/sources/bioformats/large_image_source_bioformats/__init__.py @@ -767,6 +767,10 @@ def addKnownExtensions(cls): 'fake', 'no'}: if ext not in cls.extensions: cls.extensions[ext] = SourcePriority.IMPLICIT + # These were found by reading some OMERO test files + for ext in {'columbusidx', 'dv_vol', 'lifext'}: + if ext.lower() not in cls.extensions: + cls.extensions[ext.lower()] = SourcePriority.IMPLICIT_LOW def open(*args, **kwargs): diff --git a/sources/gdal/large_image_source_gdal/__init__.py b/sources/gdal/large_image_source_gdal/__init__.py index 5f7b2ae3e..3d88cd813 100644 --- a/sources/gdal/large_image_source_gdal/__init__.py +++ b/sources/gdal/large_image_source_gdal/__init__.py @@ -1075,6 +1075,16 @@ def addKnownExtensions(cls): if drvmimes is not None: if drvmimes not in cls.mimeTypes: cls.mimeTypes[drvmimes] = SourcePriority.IMPLICIT + # This list was compiled by trying to read the test files in GDAL's + # repo. + for ext in { + 'adf', 'aux', 'demtif', 'dim', 'doq', 'flt', 'fst', + 'gdbtable', 'gsc', 'h3', 'idf', 'lan', 'los', 'lrc', + 'mapml', 'mint.bin', 'mtw', 'nsf', 'nws', 'on2', 'on9', + 'osm.pbf', 'pjg', 'prj', 'ptf', 'rasterlite', 'rdb', 'rl2', + 'shx', 'sos', 'tif.grd', 'til', 'vic', 'xlb'}: + if ext.lower() not in cls.extensions: + cls.extensions[ext.lower()] = SourcePriority.IMPLICIT_LOW def open(*args, **kwargs): diff --git a/sources/pil/large_image_source_pil/__init__.py b/sources/pil/large_image_source_pil/__init__.py index b4b1ac5fc..6bae96297 100644 --- a/sources/pil/large_image_source_pil/__init__.py +++ b/sources/pil/large_image_source_pil/__init__.py @@ -325,6 +325,10 @@ def addKnownExtensions(cls): for mimeType in PIL.Image.MIME.values(): if mimeType not in cls.mimeTypes: cls.mimeTypes[mimeType] = SourcePriority.IMPLICIT_HIGH + # These were found by reading various test files. + for ext in {'ppg'}: + if ext.lower() not in cls.extensions: + cls.extensions[ext.lower()] = SourcePriority.IMPLICIT_LOW def open(*args, **kwargs): diff --git a/sources/rasterio/large_image_source_rasterio/__init__.py b/sources/rasterio/large_image_source_rasterio/__init__.py index 973769e10..098f561ed 100644 --- a/sources/rasterio/large_image_source_rasterio/__init__.py +++ b/sources/rasterio/large_image_source_rasterio/__init__.py @@ -1077,6 +1077,15 @@ def addKnownExtensions(cls): for ext in rasterio.drivers.raster_driver_extensions(): if ext not in cls.extensions: cls.extensions[ext] = SourcePriority.IMPLICIT + # This list was compiled by trying to read the test files in GDAL's + # repo. + for ext in { + 'adf', 'aux', 'demtif', 'dim', 'doq', 'flt', 'fst', 'gsc', + 'h3', 'lan', 'los', 'lrc', 'mint.bin', 'mtw', 'nsf', 'nws', + 'on9', 'pjg', 'png.ovr', 'prj', 'ptf', 'rasterlite', 'rdb', + 'tif.grd', 'til', 'vic', 'xlb'}: + if ext.lower() not in cls.extensions: + cls.extensions[ext.lower()] = SourcePriority.IMPLICIT_LOW def open(*args, **kwargs):