large-image-source-tiff 1.27.1.dev3__tar.gz → 1.27.1.dev5__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/PKG-INFO +1 -1
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/large_image_source_tiff/__init__.py +1 -1
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/large_image_source_tiff/tiff_reader.py +9 -4
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/large_image_source_tiff.egg-info/PKG-INFO +1 -1
- large-image-source-tiff-1.27.1.dev5/large_image_source_tiff.egg-info/requires.txt +6 -0
- large-image-source-tiff-1.27.1.dev3/large_image_source_tiff.egg-info/requires.txt +0 -6
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/LICENSE +0 -0
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/README.rst +0 -0
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/large_image_source_tiff/exceptions.py +0 -0
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/large_image_source_tiff/girder_source.py +0 -0
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/large_image_source_tiff.egg-info/SOURCES.txt +0 -0
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/large_image_source_tiff.egg-info/dependency_links.txt +0 -0
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/large_image_source_tiff.egg-info/entry_points.txt +0 -0
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/large_image_source_tiff.egg-info/top_level.txt +0 -0
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/pyproject.toml +0 -0
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/setup.cfg +0 -0
- {large-image-source-tiff-1.27.1.dev3 → large-image-source-tiff-1.27.1.dev5}/setup.py +0 -0
@@ -645,7 +645,7 @@ class TiffFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
|
|
645
645
|
allowStyle = False
|
646
646
|
format = TILE_FORMAT_PIL
|
647
647
|
else:
|
648
|
-
tile = dir.getTile(x, y)
|
648
|
+
tile = dir.getTile(x, y, asarray=numpyAllowed == 'always')
|
649
649
|
format = 'JPEG'
|
650
650
|
if isinstance(tile, PIL.Image.Image):
|
651
651
|
format = TILE_FORMAT_PIL
|
@@ -754,7 +754,7 @@ class TiledTiffDirectory:
|
|
754
754
|
def pixelInfo(self):
|
755
755
|
return self._pixelInfo
|
756
756
|
|
757
|
-
def getTile(self, x, y):
|
757
|
+
def getTile(self, x, y, asarray=False):
|
758
758
|
"""
|
759
759
|
Get the complete JPEG image from a tile.
|
760
760
|
|
@@ -762,6 +762,8 @@ class TiledTiffDirectory:
|
|
762
762
|
:type x: int
|
763
763
|
:param y: The row index of the desired tile.
|
764
764
|
:type y: int
|
765
|
+
:param asarray: If True, read jpeg compressed images as arrays.
|
766
|
+
:type asarray: boolean
|
765
767
|
:return: either a buffer with a JPEG or a PIL image.
|
766
768
|
:rtype: bytes
|
767
769
|
:raises: InvalidOperationTiffError or IOTiffError
|
@@ -774,11 +776,14 @@ class TiledTiffDirectory:
|
|
774
776
|
tileNum = self._toTileNum(x, y)
|
775
777
|
|
776
778
|
if (not self._tiffInfo.get('istiled') or
|
777
|
-
self._tiffInfo.get('compression') not in
|
778
|
-
libtiff_ctypes.COMPRESSION_JPEG, 33003, 33005, 34712
|
779
|
+
self._tiffInfo.get('compression') not in {
|
780
|
+
libtiff_ctypes.COMPRESSION_JPEG, 33003, 33005, 34712} or
|
779
781
|
self._tiffInfo.get('bitspersample') != 8 or
|
780
782
|
self._tiffInfo.get('sampleformat') not in {
|
781
|
-
None, libtiff_ctypes.SAMPLEFORMAT_UINT}
|
783
|
+
None, libtiff_ctypes.SAMPLEFORMAT_UINT} or
|
784
|
+
(asarray and self._tiffInfo.get('compression') not in {33003, 33005, 34712} and (
|
785
|
+
self._tiffInfo.get('compression') != libtiff_ctypes.COMPRESSION_JPEG or
|
786
|
+
self._tiffInfo.get('photometric') != libtiff_ctypes.PHOTOMETRIC_YCBCR))):
|
782
787
|
return self._getUncompressedTile(tileNum)
|
783
788
|
|
784
789
|
imageBuffer = io.BytesIO()
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|