large-image-converter 1.32.9.dev38__py3-none-any.whl → 1.32.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of large-image-converter might be problematic. Click here for more details.
- large_image_converter/__init__.py +17 -13
- {large_image_converter-1.32.9.dev38.dist-info → large_image_converter-1.32.10.dist-info}/METADATA +4 -4
- large_image_converter-1.32.10.dist-info/RECORD +9 -0
- large_image_converter-1.32.9.dev38.dist-info/RECORD +0 -9
- {large_image_converter-1.32.9.dev38.dist-info → large_image_converter-1.32.10.dist-info}/WHEEL +0 -0
- {large_image_converter-1.32.9.dev38.dist-info → large_image_converter-1.32.10.dist-info}/entry_points.txt +0 -0
- {large_image_converter-1.32.9.dev38.dist-info → large_image_converter-1.32.10.dist-info}/licenses/LICENSE +0 -0
- {large_image_converter-1.32.9.dev38.dist-info → large_image_converter-1.32.10.dist-info}/top_level.txt +0 -0
|
@@ -843,7 +843,7 @@ def _is_lossy(path, tiffinfo=None):
|
|
|
843
843
|
|
|
844
844
|
def _is_multiframe(path):
|
|
845
845
|
"""
|
|
846
|
-
Check if a path is a multiframe file.
|
|
846
|
+
Check if a path is a multiframe file according to vips.
|
|
847
847
|
|
|
848
848
|
:param path: The path to the file
|
|
849
849
|
:returns: True if multiframe.
|
|
@@ -853,18 +853,17 @@ def _is_multiframe(path):
|
|
|
853
853
|
with _newFromFileLock:
|
|
854
854
|
image = pyvips.Image.new_from_file(path)
|
|
855
855
|
except Exception:
|
|
856
|
-
|
|
857
|
-
open(path, 'rb').read(1)
|
|
858
|
-
raise
|
|
859
|
-
except Exception:
|
|
860
|
-
logger.warning('Is the file reachable and readable? (%r)', path)
|
|
861
|
-
raise OSError(path) from None
|
|
856
|
+
return None
|
|
862
857
|
pages = 1
|
|
863
858
|
if 'n-pages' in image.get_fields():
|
|
864
859
|
pages = image.get_value('n-pages')
|
|
865
860
|
return pages > 1
|
|
866
861
|
|
|
867
862
|
|
|
863
|
+
def _is_new(path):
|
|
864
|
+
return os.path.basename(path).startswith(large_image.constants.NEW_IMAGE_PATH_FLAG)
|
|
865
|
+
|
|
866
|
+
|
|
868
867
|
def _list_possible_sizes(width, height):
|
|
869
868
|
"""
|
|
870
869
|
Given a width and height, return a list of possible sizes that could be
|
|
@@ -1038,12 +1037,15 @@ def convert(inputPath, outputPath=None, **kwargs): # noqa: C901
|
|
|
1038
1037
|
lidata = _data_from_large_image(str(inputPath), tempPath, **kwargs)
|
|
1039
1038
|
logger.log(logging.DEBUG - 1, 'large_image information for %s: %r',
|
|
1040
1039
|
inputPath, lidata)
|
|
1041
|
-
if lidata and (
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1040
|
+
if lidata and (_is_new(inputPath) or _is_multiframe(inputPath)):
|
|
1041
|
+
_convert_large_image(inputPath, outputPath, tempPath, lidata, **kwargs)
|
|
1042
|
+
elif lidata and (
|
|
1043
|
+
(len(lidata['metadata'].get('frames', [])) >= 2 and
|
|
1044
|
+
not _is_multiframe(inputPath)) or
|
|
1045
|
+
(np.dtype(lidata['tilesource'].dtype) != np.uint8 and
|
|
1046
|
+
np.dtype(lidata['tilesource'].dtype) != np.uint16) or
|
|
1047
|
+
not is_vips(inputPath, (lidata['metadata']['sizeX'], lidata['metadata']['sizeY']))
|
|
1048
|
+
):
|
|
1047
1049
|
_convert_large_image(inputPath, outputPath, tempPath, lidata, **kwargs)
|
|
1048
1050
|
elif _is_multiframe(inputPath):
|
|
1049
1051
|
_generate_multiframe_tiff(inputPath, outputPath, tempPath, lidata, **kwargs)
|
|
@@ -1053,6 +1055,8 @@ def convert(inputPath, outputPath=None, **kwargs): # noqa: C901
|
|
|
1053
1055
|
except Exception:
|
|
1054
1056
|
if lidata:
|
|
1055
1057
|
_convert_large_image(inputPath, outputPath, tempPath, lidata, **kwargs)
|
|
1058
|
+
else:
|
|
1059
|
+
raise
|
|
1056
1060
|
return outputPath
|
|
1057
1061
|
|
|
1058
1062
|
|
{large_image_converter-1.32.9.dev38.dist-info → large_image_converter-1.32.10.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: large-image-converter
|
|
3
|
-
Version: 1.32.
|
|
3
|
+
Version: 1.32.10
|
|
4
4
|
Summary: Converter for Large Image.
|
|
5
5
|
Author: Kitware Inc
|
|
6
6
|
Author-email: kitware@kitware.com
|
|
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
18
18
|
Requires-Python: >=3.8
|
|
19
19
|
Description-Content-Type: text/x-rst
|
|
20
20
|
License-File: LICENSE
|
|
21
|
-
Requires-Dist: large-image-source-tiff>=1.32.
|
|
21
|
+
Requires-Dist: large-image-source-tiff>=1.32.10
|
|
22
22
|
Requires-Dist: numpy
|
|
23
23
|
Requires-Dist: psutil
|
|
24
24
|
Requires-Dist: pyvips
|
|
@@ -28,14 +28,14 @@ Requires-Dist: glymur; extra == "jp2k"
|
|
|
28
28
|
Provides-Extra: geospatial
|
|
29
29
|
Requires-Dist: gdal; extra == "geospatial"
|
|
30
30
|
Provides-Extra: sources
|
|
31
|
-
Requires-Dist: large-image[sources]>=1.32.
|
|
31
|
+
Requires-Dist: large-image[sources]>=1.32.10; extra == "sources"
|
|
32
32
|
Provides-Extra: stats
|
|
33
33
|
Requires-Dist: packaging; extra == "stats"
|
|
34
34
|
Requires-Dist: scikit-image; extra == "stats"
|
|
35
35
|
Provides-Extra: all
|
|
36
36
|
Requires-Dist: glymur; extra == "all"
|
|
37
37
|
Requires-Dist: gdal; extra == "all"
|
|
38
|
-
Requires-Dist: large-image[sources]>=1.32.
|
|
38
|
+
Requires-Dist: large-image[sources]>=1.32.10; extra == "all"
|
|
39
39
|
Requires-Dist: packaging; extra == "all"
|
|
40
40
|
Requires-Dist: scikit-image; extra == "all"
|
|
41
41
|
Dynamic: author
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
large_image_converter/__init__.py,sha256=8HscZ_keOmia7JafR33ZSLIY8uXMplobg_nNE4gCN9E,44595
|
|
2
|
+
large_image_converter/__main__.py,sha256=SZOjDmX42vH4GcKB_5wdDHyB-aOy9LCx4_J97vQEjug,13358
|
|
3
|
+
large_image_converter/format_aperio.py,sha256=NkKY3gaSjPlfxvcTQgFiMADdq_mkdpKjGQ7WT_QsvaM,11761
|
|
4
|
+
large_image_converter-1.32.10.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
|
5
|
+
large_image_converter-1.32.10.dist-info/METADATA,sha256=fOO90lpfu2gzxZe5pB1dC1yrplp9o5DDebqYzWG7Ja4,4825
|
|
6
|
+
large_image_converter-1.32.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
large_image_converter-1.32.10.dist-info/entry_points.txt,sha256=TkXGWAaHgquk_ZXfqHTjQLjv8RZriv6ioiJd7JL6UIs,78
|
|
8
|
+
large_image_converter-1.32.10.dist-info/top_level.txt,sha256=cdRa-ZWWKzVHFsjK1Aq1f4bzAMPc3sgCpprmvpYczKg,22
|
|
9
|
+
large_image_converter-1.32.10.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
large_image_converter/__init__.py,sha256=gAUfTuJ4_GdV_ltb21QLTCY3dkJVu_e-GF5Ll8Pzxsk,44445
|
|
2
|
-
large_image_converter/__main__.py,sha256=SZOjDmX42vH4GcKB_5wdDHyB-aOy9LCx4_J97vQEjug,13358
|
|
3
|
-
large_image_converter/format_aperio.py,sha256=NkKY3gaSjPlfxvcTQgFiMADdq_mkdpKjGQ7WT_QsvaM,11761
|
|
4
|
-
large_image_converter-1.32.9.dev38.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
|
5
|
-
large_image_converter-1.32.9.dev38.dist-info/METADATA,sha256=bVJGP2NAKR3ZizKQviTfoZDaYt_bwkPrcDwjKJq-z40,4845
|
|
6
|
-
large_image_converter-1.32.9.dev38.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
-
large_image_converter-1.32.9.dev38.dist-info/entry_points.txt,sha256=TkXGWAaHgquk_ZXfqHTjQLjv8RZriv6ioiJd7JL6UIs,78
|
|
8
|
-
large_image_converter-1.32.9.dev38.dist-info/top_level.txt,sha256=cdRa-ZWWKzVHFsjK1Aq1f4bzAMPc3sgCpprmvpYczKg,22
|
|
9
|
-
large_image_converter-1.32.9.dev38.dist-info/RECORD,,
|
{large_image_converter-1.32.9.dev38.dist-info → large_image_converter-1.32.10.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|