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.
Files changed (17) hide show
  1. {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/PKG-INFO +1 -1
  2. {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff/tiff_reader.py +15 -16
  3. {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
  4. large-image-source-tiff-1.27.4/large_image_source_tiff.egg-info/requires.txt +6 -0
  5. large-image-source-tiff-1.27.3.dev26/large_image_source_tiff.egg-info/requires.txt +0 -6
  6. {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/LICENSE +0 -0
  7. {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/README.rst +0 -0
  8. {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff/__init__.py +0 -0
  9. {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff/exceptions.py +0 -0
  10. {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/large_image_source_tiff/girder_source.py +0 -0
  11. {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
  12. {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
  13. {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
  14. {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
  15. {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/pyproject.toml +0 -0
  16. {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/setup.cfg +0 -0
  17. {large-image-source-tiff-1.27.3.dev26 → large-image-source-tiff-1.27.4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: large-image-source-tiff
3
- Version: 1.27.3.dev26
3
+ Version: 1.27.4
4
4
  Summary: A TIFF tilesource for large_image.
5
5
  Home-page: https://github.com/girder/large_image
6
6
  Author: Kitware, Inc.
@@ -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
- imageBuffer = ctypes.create_string_buffer(tileSize)
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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: large-image-source-tiff
3
- Version: 1.27.3.dev26
3
+ Version: 1.27.4
4
4
  Summary: A TIFF tilesource for large_image.
5
5
  Home-page: https://github.com/girder/large_image
6
6
  Author: Kitware, Inc.
@@ -0,0 +1,6 @@
1
+ large-image>=1.27.4
2
+ pylibtiff
3
+ tifftools>=1.2.0
4
+
5
+ [girder]
6
+ girder-large-image>=1.27.4
@@ -1,6 +0,0 @@
1
- large-image>=1.27.3.dev26
2
- pylibtiff
3
- tifftools>=1.2.0
4
-
5
- [girder]
6
- girder-large-image>=1.27.3.dev26