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