large-image-converter 1.29.2.dev19__py3-none-any.whl → 1.29.2.dev21__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.
@@ -927,7 +927,8 @@ def convert(inputPath, outputPath=None, **kwargs): # noqa: C901
927
927
  lidata = _data_from_large_image(str(inputPath), tempPath, **kwargs)
928
928
  logger.log(logging.DEBUG - 1, 'large_image information for %s: %r',
929
929
  inputPath, lidata)
930
- if lidata and (not is_vips(inputPath) or (
930
+ if lidata and (not is_vips(
931
+ inputPath, (lidata['metadata']['sizeX'], lidata['metadata']['sizeY'])) or (
931
932
  len(lidata['metadata'].get('frames', [])) >= 2 and
932
933
  not _is_multiframe(inputPath))):
933
934
  _convert_large_image(inputPath, outputPath, tempPath, lidata, **kwargs)
@@ -967,11 +968,13 @@ def is_geospatial(path):
967
968
  return False
968
969
 
969
970
 
970
- def is_vips(path):
971
+ def is_vips(path, matchSize=None):
971
972
  """
972
973
  Check if a path is readable by vips.
973
974
 
974
975
  :param path: The path to the file
976
+ :param matchSize: if not None, the image read by vips must be the specified
977
+ (width, height) tuple in pixels.
975
978
  :returns: True if readable by vips.
976
979
  """
977
980
  _import_pyvips()
@@ -981,6 +984,8 @@ def is_vips(path):
981
984
  # image(0, 0) will throw if vips can't decode the image
982
985
  if not image.width or not image.height or image(0, 0) is None:
983
986
  return False
987
+ if matchSize and (matchSize[0] != image.width or matchSize[1] != image.height):
988
+ return False
984
989
  except Exception:
985
990
  return False
986
991
  return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: large-image-converter
3
- Version: 1.29.2.dev19
3
+ Version: 1.29.2.dev21
4
4
  Summary: Converter for Large Image.
5
5
  Author: Kitware Inc
6
6
  Author-email: kitware@kitware.com
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
18
  Requires-Python: >=3.8
19
19
  License-File: LICENSE
20
- Requires-Dist: large-image-source-tiff >=1.29.2.dev19
20
+ Requires-Dist: large-image-source-tiff >=1.29.2.dev21
21
21
  Requires-Dist: numpy
22
22
  Requires-Dist: psutil
23
23
  Requires-Dist: pyvips
@@ -25,7 +25,7 @@ Requires-Dist: tifftools
25
25
  Provides-Extra: all
26
26
  Requires-Dist: glymur ; extra == 'all'
27
27
  Requires-Dist: gdal ; extra == 'all'
28
- Requires-Dist: large-image[sources] >=1.29.2.dev19 ; extra == 'all'
28
+ Requires-Dist: large-image[sources] >=1.29.2.dev21 ; extra == 'all'
29
29
  Requires-Dist: packaging ; extra == 'all'
30
30
  Requires-Dist: scikit-image ; extra == 'all'
31
31
  Provides-Extra: geospatial
@@ -33,7 +33,7 @@ Requires-Dist: gdal ; extra == 'geospatial'
33
33
  Provides-Extra: jp2k
34
34
  Requires-Dist: glymur ; extra == 'jp2k'
35
35
  Provides-Extra: sources
36
- Requires-Dist: large-image[sources] >=1.29.2.dev19 ; extra == 'sources'
36
+ Requires-Dist: large-image[sources] >=1.29.2.dev21 ; extra == 'sources'
37
37
  Provides-Extra: stats
38
38
  Requires-Dist: packaging ; extra == 'stats'
39
39
  Requires-Dist: scikit-image ; extra == 'stats'
@@ -0,0 +1,9 @@
1
+ large_image_converter/__init__.py,sha256=EWUP451w9VZpI23NT7gw4fKIn2ouiROi_kA6ikfhxSY,39283
2
+ large_image_converter/__main__.py,sha256=bGQaCR01kTGTnW2c2Z9z5BIiPSpCRPfj7_kPgppLeB4,13353
3
+ large_image_converter/format_aperio.py,sha256=NkKY3gaSjPlfxvcTQgFiMADdq_mkdpKjGQ7WT_QsvaM,11761
4
+ large_image_converter-1.29.2.dev21.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
5
+ large_image_converter-1.29.2.dev21.dist-info/METADATA,sha256=1Jm7OceRZgBt2Ci0r0oq76biVDb5ixA9a2W3IlfQ4uQ,4609
6
+ large_image_converter-1.29.2.dev21.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
7
+ large_image_converter-1.29.2.dev21.dist-info/entry_points.txt,sha256=TkXGWAaHgquk_ZXfqHTjQLjv8RZriv6ioiJd7JL6UIs,78
8
+ large_image_converter-1.29.2.dev21.dist-info/top_level.txt,sha256=cdRa-ZWWKzVHFsjK1Aq1f4bzAMPc3sgCpprmvpYczKg,22
9
+ large_image_converter-1.29.2.dev21.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.2.0)
2
+ Generator: setuptools (70.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,9 +0,0 @@
1
- large_image_converter/__init__.py,sha256=n_w-WGcUDo7ydJN-TU_5CbK_TjTNJnn_VL8MakhgiME,38952
2
- large_image_converter/__main__.py,sha256=bGQaCR01kTGTnW2c2Z9z5BIiPSpCRPfj7_kPgppLeB4,13353
3
- large_image_converter/format_aperio.py,sha256=NkKY3gaSjPlfxvcTQgFiMADdq_mkdpKjGQ7WT_QsvaM,11761
4
- large_image_converter-1.29.2.dev19.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
5
- large_image_converter-1.29.2.dev19.dist-info/METADATA,sha256=jHosBL96rBHIMEgIo5x_tm5BvF-qSICOj8X5s4F3yb4,4609
6
- large_image_converter-1.29.2.dev19.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
7
- large_image_converter-1.29.2.dev19.dist-info/entry_points.txt,sha256=TkXGWAaHgquk_ZXfqHTjQLjv8RZriv6ioiJd7JL6UIs,78
8
- large_image_converter-1.29.2.dev19.dist-info/top_level.txt,sha256=cdRa-ZWWKzVHFsjK1Aq1f4bzAMPc3sgCpprmvpYczKg,22
9
- large_image_converter-1.29.2.dev19.dist-info/RECORD,,