From 8970915809fb1dc9bc41dd2047957e0fa3c6c390 Mon Sep 17 00:00:00 2001 From: "Christian R. Picone" Date: Fri, 9 Apr 2021 12:29:38 +0200 Subject: [PATCH] fix is_processed method (removing the check on overviews, just printing a warning message) --- geotiflib/geotiff.py | 6 +++--- ...f => AC04078710_colorinterp_is_undefined.tif} | Bin tests/data/AC04078710_no_overviews.tif | Bin 0 -> 9205 bytes tests/test_geotiff.py | 10 ++++++++-- tests/test_tilejpegtask.py | 1 + 5 files changed, 12 insertions(+), 5 deletions(-) rename tests/data/{AC04078710_7mb.tif => AC04078710_colorinterp_is_undefined.tif} (100%) create mode 100644 tests/data/AC04078710_no_overviews.tif diff --git a/geotiflib/geotiff.py b/geotiflib/geotiff.py index 42ad61e..496d9be 100644 --- a/geotiflib/geotiff.py +++ b/geotiflib/geotiff.py @@ -29,13 +29,13 @@ def is_processed(self): :return: """ info = self.info() - print(info) + if "Overviews:" not in info: + print("WARNING: the image does not contain overviews layers!") return "COMPRESSION=YCbCr JPEG" in info \ and "Corner Coordinates:" in info \ and "Band 1 Block=512x512 Type=Byte, ColorInterp=Red" in info \ and "Band 2 Block=512x512 Type=Byte, ColorInterp=Green" in info \ - and "Band 3 Block=512x512 Type=Byte, ColorInterp=Blue" in info \ - and "Overviews:" in info + and "Band 3 Block=512x512 Type=Byte, ColorInterp=Blue" in info def metadata(self, name): """ diff --git a/tests/data/AC04078710_7mb.tif b/tests/data/AC04078710_colorinterp_is_undefined.tif similarity index 100% rename from tests/data/AC04078710_7mb.tif rename to tests/data/AC04078710_colorinterp_is_undefined.tif diff --git a/tests/data/AC04078710_no_overviews.tif b/tests/data/AC04078710_no_overviews.tif new file mode 100644 index 0000000000000000000000000000000000000000..437095b5f60ef3f5801f4eaef3a4931679587c15 GIT binary patch literal 9205 zcmeHqc{tly|90r2x^LF1wupUSYS*W&rHK(05yUpCp<$8`JH$vO9(1q4zA8~^|S zrvU)IJpeu)`i)olzT$Kq=I7x(ytvJ)d%pGy@bLbxcs~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