diff --git a/CHANGELOG.md b/CHANGELOG.md index a71a76df7..d05ea3c41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 1.26.3 +### Improvements +- Reduce stderr noise in PIL and rasterio sources ([#1397](../../pull/1397)) + ### Bug Fixes - Fix an issue emitting geojson annotations ([#1395](../../pull/1395)) - Fix an issue when tifffile reports no key frame ([#1396](../../pull/1396)) diff --git a/sources/pil/large_image_source_pil/__init__.py b/sources/pil/large_image_source_pil/__init__.py index 361fab9be..5ac2fb726 100644 --- a/sources/pil/large_image_source_pil/__init__.py +++ b/sources/pil/large_image_source_pil/__init__.py @@ -202,8 +202,10 @@ def _fromRawpy(self, largeImagePath): try: import rawpy - rgb = rawpy.imread(largeImagePath).postprocess() - rgb = large_image.tilesource.utilities._imageToNumpy(rgb) + rgb = rawpy._rawpy.RawPy(1) + rgb.open_file(largeImagePath) + rgb = rgb.postprocess() + rgb = large_image.tilesource.utilities._imageToNumpy(rgb)[0] if rgb.shape[2] == 2: rgb = rgb[:, :, :1] elif rgb.shape[2] > 3: diff --git a/sources/rasterio/large_image_source_rasterio/__init__.py b/sources/rasterio/large_image_source_rasterio/__init__.py index f40ebb06c..20bf8e60a 100644 --- a/sources/rasterio/large_image_source_rasterio/__init__.py +++ b/sources/rasterio/large_image_source_rasterio/__init__.py @@ -52,6 +52,7 @@ pass warnings.filterwarnings('ignore', category=rio.errors.NotGeoreferencedWarning, module='rasterio') +rio._env.code_map.pop(1, None) def make_crs(projection):