diff --git a/CHANGELOG.md b/CHANGELOG.md index 12e585695..2f8a8b9e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Pass style to histogram endpoint as json ([#1220](../../pull/1220)) - Don't show frame controls outside of the geojs viewer ([#1226](../../pull/1226)) - Fix updating the hidden style field for the frame selector ([#1227](../../pull/1227)) +- Fix a bug calculating some histograms ([#1231](../../pull/1231)) ## 1.23.0 diff --git a/large_image/cache_util/cache.py b/large_image/cache_util/cache.py index 9a02cd070..e999ea7f2 100644 --- a/large_image/cache_util/cache.py +++ b/large_image/cache_util/cache.py @@ -199,9 +199,10 @@ def __call__(cls, *args, **kwargs): # noqa - N805 except KeyError: pass # This conditionally copies a non-styled class and adds a style. - if kwargs.get('style') and hasattr(cls, '_setStyle'): + if (kwargs.get('style') and hasattr(cls, '_setStyle') and + kwargs.get('style') != getattr(cls, '_unstyledStyle', None)): subkwargs = kwargs.copy() - subkwargs.pop('style') + subkwargs['style'] = getattr(cls, '_unstyledStyle', None) subresult = cls(*args, **subkwargs) result = subresult.__class__.__new__(subresult.__class__) with subresult._sourceLock: diff --git a/large_image/tilesource/geo.py b/large_image/tilesource/geo.py index 852e95507..91c2c48f5 100644 --- a/large_image/tilesource/geo.py +++ b/large_image/tilesource/geo.py @@ -55,6 +55,8 @@ class GDALBaseFileTileSource(GeoBaseFileTileSource): (rasterio, mapnik, etc.) """ + _unstyledStyle = '{}' + extensions = { None: SourcePriority.MEDIUM, 'geotiff': SourcePriority.PREFERRED,