diff --git a/CHANGELOG.md b/CHANGELOG.md index d3608d6a9..e9fc22261 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,16 @@ - Format dates in item lists ([#1707](../../pull/1707)) - Guard dtype types ([#1711](../../pull/1711), [#1714](../../pull/1714), [#1716](../../pull/1716)) - Better handle IndicaLabs tiff files ([#1717](../../pull/1717)) +- Better detect files with geotransform data that aren't geospatial ([#1718](../../pull/1718)) ### Changes - Openslide now requires the binary wheel on appropriate platforms ([#1709](../../pull/1709), [#1710](../../pull/1710)) +### Bug Fixes + +- Fix an issue searching for annotation metadata on items that a user doesn't have permissions to view ([#1723](../../pull/1723)) + ## 1.30.2 ### Features diff --git a/girder/girder_large_image/__init__.py b/girder/girder_large_image/__init__.py index fcf98ae5d..95891c2a4 100644 --- a/girder/girder_large_image/__init__.py +++ b/girder/girder_large_image/__init__.py @@ -428,7 +428,12 @@ def metadataSearchHandler( # noqa if id in foundIds: continue foundIds.add(id) - entry = resultModelInst.load(id=id, user=user, level=level, exc=False) + try: + entry = resultModelInst.load(id=id, user=user, level=level, exc=False) + except Exception: + # We might have permission to view an annotation but not + # the item + continue if entry is not None and offset: offset -= 1 continue diff --git a/sources/gdal/large_image_source_gdal/__init__.py b/sources/gdal/large_image_source_gdal/__init__.py index 2033eeb5e..25c99d7ae 100644 --- a/sources/gdal/large_image_source_gdal/__init__.py +++ b/sources/gdal/large_image_source_gdal/__init__.py @@ -979,7 +979,13 @@ def isGeospatial(path): if ds.GetProjection(): return True if ds.GetGeoTransform(can_return_null=True): - return True + w = ds.RasterXSize + h = ds.RasterYSize + trans = ds.GetGeoTransform(can_return_null=True) + cornersy = [trans[3] + x * trans[4] + y * trans[5] + for x, y in {(0, 0), (0, h), (w, 0), (w, h)}] + if min(cornersy) >= -90 and max(cornersy) <= 90: + return True if ds.GetDriver().ShortName in {'NITF', 'netCDF'}: return True return False diff --git a/test.Dockerfile b/test.Dockerfile index 5008877d5..452293ed4 100644 --- a/test.Dockerfile +++ b/test.Dockerfile @@ -74,16 +74,20 @@ RUN apt-get update && \ curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash && \ find / -xdev -name __pycache__ -type d -exec rm -r {} \+ && \ rm -r /etc/ssh/ssh_host* && \ + rm -rf /usr/share/vim/vim91/{doc,tutor}/* /usr/share/doc && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/* RUN git clone "https://github.com/universal-ctags/ctags.git" "./ctags" && \ cd ./ctags && \ ./autogen.sh && \ ./configure && \ + export CFLAGS="-g0 -Os -DNDEBUG" && \ + export LDFLAGS="-Wl,--strip-debug,--strip-discarded,--discard-locals" && \ make -j `nproc` && \ make install -j `nproc` && \ cd .. && \ - rm -rf ./ctags + rm -rf ./ctags && \ + rdfind -minsize 32768 -makehardlinks true -makeresultsfile false /usr/local/bin RUN pyenv update && \ pyenv install --list && \ @@ -95,7 +99,9 @@ RUN pyenv update && \ find $PYENV_ROOT/versions -type f '(' -name '*.py[co]' -o -name '*.exe' ')' -exec rm -fv '{}' + >/dev/null && \ echo $PYTHON_VERSIONS | tr " " "\n" > $PYENV_ROOT/version && \ find / -xdev -name __pycache__ -type d -exec rm -r {} \+ && \ - rm -rf /tmp/* /var/tmp/* && \ + rm -rf /tmp/* /var/tmp/* /root/.cache/* && \ + find /.pyenv -name '*.so' -o -name '*.a' -o -name '*.so.*' -exec strip --strip-unneeded -p -D {} \; && \ + find /.pyenv -name 'libpython*.a' -delete && \ # This makes duplicate python library files hardlinks of each other \ rdfind -minsize 32768 -makehardlinks true -makeresultsfile false /.pyenv @@ -118,6 +124,7 @@ RUN . ~/.bashrc && \ nvm install 14 && \ nvm alias default 14 && \ nvm use default && \ + rm -rf /root/.nvm/.cache && \ ln -s $(dirname `which npm`) /usr/local/node ENV PATH="/usr/local/node:$PATH"