large-image-source-tiff 1.27.3.dev26__tar.gz → 1.27.4__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.3.dev26 → large-image-source-tiff-1.27.4}/PKG-INFO +1 -1
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff/tiff_reader.py +15 -16
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff.egg-info/PKG-INFO +1 -1
- large-image-source-tiff-1.27.4/large_image_source_tiff.egg-info/requires.txt +6 -0
- large-image-source-tiff-1.27.3.dev26/large_image_source_tiff.egg-info/requires.txt +0 -6
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/LICENSE +0 -0
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/README.rst +0 -0
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff/__init__.py +0 -0
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff/exceptions.py +0 -0
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff/girder_source.py +0 -0
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff.egg-info/SOURCES.txt +0 -0
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff.egg-info/dependency_links.txt +0 -0
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff.egg-info/entry_points.txt +0 -0
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff.egg-info/top_level.txt +0 -0
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/pyproject.toml +0 -0
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/setup.cfg +0 -0
- {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/setup.py +0 -0
@@ -596,13 +596,27 @@ class TiledTiffDirectory:
|
|
596
596
|
self._tiffFile).value
|
597
597
|
stripsCount = min(self._stripsPerTile, self._stripCount - tileNum)
|
598
598
|
tileSize = stripSize * self._stripsPerTile
|
599
|
-
|
599
|
+
tw, th = self._tileWidth, self._tileHeight
|
600
|
+
if self._tiffInfo.get('orientation') in {
|
601
|
+
libtiff_ctypes.ORIENTATION_LEFTTOP,
|
602
|
+
libtiff_ctypes.ORIENTATION_RIGHTTOP,
|
603
|
+
libtiff_ctypes.ORIENTATION_RIGHTBOT,
|
604
|
+
libtiff_ctypes.ORIENTATION_LEFTBOT}:
|
605
|
+
tw, th = th, tw
|
606
|
+
format = (
|
607
|
+
self._tiffInfo.get('bitspersample'),
|
608
|
+
self._tiffInfo.get('sampleformat') if self._tiffInfo.get(
|
609
|
+
'sampleformat') is not None else libtiff_ctypes.SAMPLEFORMAT_UINT)
|
610
|
+
image = np.empty((th, tw, self._tiffInfo['samplesperpixel']),
|
611
|
+
dtype=_ctypesFormattbl[format])
|
612
|
+
imageBuffer = image.ctypes.data_as(ctypes.POINTER(ctypes.c_char))
|
600
613
|
if self._tiffInfo.get('istiled'):
|
601
614
|
with self._tileLock:
|
602
615
|
readSize = libtiff_ctypes.libtiff.TIFFReadEncodedTile(
|
603
616
|
self._tiffFile, tileNum, imageBuffer, tileSize)
|
604
617
|
else:
|
605
618
|
readSize = 0
|
619
|
+
imageBuffer = ctypes.cast(imageBuffer, ctypes.POINTER(ctypes.c_char * 2)).contents
|
606
620
|
for stripNum in range(stripsCount):
|
607
621
|
with self._tileLock:
|
608
622
|
chunkSize = libtiff_ctypes.libtiff.TIFFReadEncodedStrip(
|
@@ -621,21 +635,6 @@ class TiledTiffDirectory:
|
|
621
635
|
raise IOTiffError(
|
622
636
|
'Read an unexpected number of bytes from an encoded tile' if readSize >= 0 else
|
623
637
|
'Failed to read from an encoded tile')
|
624
|
-
tw, th = self._tileWidth, self._tileHeight
|
625
|
-
if self._tiffInfo.get('orientation') in {
|
626
|
-
libtiff_ctypes.ORIENTATION_LEFTTOP,
|
627
|
-
libtiff_ctypes.ORIENTATION_RIGHTTOP,
|
628
|
-
libtiff_ctypes.ORIENTATION_RIGHTBOT,
|
629
|
-
libtiff_ctypes.ORIENTATION_LEFTBOT}:
|
630
|
-
tw, th = th, tw
|
631
|
-
format = (
|
632
|
-
self._tiffInfo.get('bitspersample'),
|
633
|
-
self._tiffInfo.get('sampleformat') if self._tiffInfo.get(
|
634
|
-
'sampleformat') is not None else libtiff_ctypes.SAMPLEFORMAT_UINT)
|
635
|
-
image = np.ctypeslib.as_array(ctypes.cast(
|
636
|
-
imageBuffer, ctypes.POINTER(ctypes.c_uint8)), (tileSize, )).view(
|
637
|
-
_ctypesFormattbl[format]).reshape(
|
638
|
-
(th, tw, self._tiffInfo['samplesperpixel']))
|
639
638
|
if (self._tiffInfo.get('samplesperpixel') == 3 and
|
640
639
|
self._tiffInfo.get('photometric') == libtiff_ctypes.PHOTOMETRIC_YCBCR):
|
641
640
|
if self._tiffInfo.get('bitspersample') == 16:
|
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
|
File without changes
|