imageio 2.34.1__tar.gz → 2.34.2__tar.gz

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.
Files changed (126) hide show
  1. {imageio-2.34.1/imageio.egg-info → imageio-2.34.2}/PKG-INFO +1 -1
  2. {imageio-2.34.1 → imageio-2.34.2}/imageio/__init__.py +1 -1
  3. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/request.py +3 -0
  4. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/util.py +2 -0
  5. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/_dicom.py +1 -1
  6. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/pillow_legacy.py +1 -3
  7. {imageio-2.34.1 → imageio-2.34.2/imageio.egg-info}/PKG-INFO +1 -1
  8. {imageio-2.34.1 → imageio-2.34.2}/tests/conftest.py +12 -14
  9. {imageio-2.34.1 → imageio-2.34.2}/tests/test_ffmpeg.py +5 -0
  10. {imageio-2.34.1 → imageio-2.34.2}/tests/test_ffmpeg_info.py +7 -1
  11. {imageio-2.34.1 → imageio-2.34.2}/tests/test_freeimage.py +4 -1
  12. {imageio-2.34.1 → imageio-2.34.2}/tests/test_pillow.py +10 -0
  13. {imageio-2.34.1 → imageio-2.34.2}/tests/test_pyav.py +2 -2
  14. {imageio-2.34.1 → imageio-2.34.2}/CONTRIBUTORS.txt +0 -0
  15. {imageio-2.34.1 → imageio-2.34.2}/LICENSE +0 -0
  16. {imageio-2.34.1 → imageio-2.34.2}/MANIFEST.in +0 -0
  17. {imageio-2.34.1 → imageio-2.34.2}/README.md +0 -0
  18. {imageio-2.34.1 → imageio-2.34.2}/docs/Makefile +0 -0
  19. {imageio-2.34.1 → imageio-2.34.2}/docs/_static/imageio_logo.png +0 -0
  20. {imageio-2.34.1 → imageio-2.34.2}/docs/_templates/better_class.rst +0 -0
  21. {imageio-2.34.1 → imageio-2.34.2}/docs/_templates/formats.rst.template +0 -0
  22. {imageio-2.34.1 → imageio-2.34.2}/docs/_templates/plugin.rst +0 -0
  23. {imageio-2.34.1 → imageio-2.34.2}/docs/conf.py +0 -0
  24. {imageio-2.34.1 → imageio-2.34.2}/docs/development/index.rst +0 -0
  25. {imageio-2.34.1 → imageio-2.34.2}/docs/development/plugins.rst +0 -0
  26. {imageio-2.34.1 → imageio-2.34.2}/docs/examples.rst +0 -0
  27. {imageio-2.34.1 → imageio-2.34.2}/docs/formats/formats_by_plugin.rst +0 -0
  28. {imageio-2.34.1 → imageio-2.34.2}/docs/formats/index.rst +0 -0
  29. {imageio-2.34.1 → imageio-2.34.2}/docs/formats/video_formats.rst +0 -0
  30. {imageio-2.34.1 → imageio-2.34.2}/docs/imageio_ext.py +0 -0
  31. {imageio-2.34.1 → imageio-2.34.2}/docs/index.rst +0 -0
  32. {imageio-2.34.1 → imageio-2.34.2}/docs/make.bat +0 -0
  33. {imageio-2.34.1 → imageio-2.34.2}/docs/reference/core_v3.rst +0 -0
  34. {imageio-2.34.1 → imageio-2.34.2}/docs/reference/index.rst +0 -0
  35. {imageio-2.34.1 → imageio-2.34.2}/docs/reference/userapi.rst +0 -0
  36. {imageio-2.34.1 → imageio-2.34.2}/docs/user_guide/cmdlinescripts.rst +0 -0
  37. {imageio-2.34.1 → imageio-2.34.2}/docs/user_guide/drop27.rst +0 -0
  38. {imageio-2.34.1 → imageio-2.34.2}/docs/user_guide/envvariables.rst +0 -0
  39. {imageio-2.34.1 → imageio-2.34.2}/docs/user_guide/freezing.rst +0 -0
  40. {imageio-2.34.1 → imageio-2.34.2}/docs/user_guide/index.rst +0 -0
  41. {imageio-2.34.1 → imageio-2.34.2}/docs/user_guide/installation.rst +0 -0
  42. {imageio-2.34.1 → imageio-2.34.2}/docs/user_guide/overview.rst +0 -0
  43. {imageio-2.34.1 → imageio-2.34.2}/docs/user_guide/requests.rst +0 -0
  44. {imageio-2.34.1 → imageio-2.34.2}/docs/user_guide/scipy.rst +0 -0
  45. {imageio-2.34.1 → imageio-2.34.2}/docs/user_guide/standardimages.rst +0 -0
  46. {imageio-2.34.1 → imageio-2.34.2}/imageio/__main__.py +0 -0
  47. {imageio-2.34.1 → imageio-2.34.2}/imageio/config/__init__.py +0 -0
  48. {imageio-2.34.1 → imageio-2.34.2}/imageio/config/extensions.py +0 -0
  49. {imageio-2.34.1 → imageio-2.34.2}/imageio/config/extensions.pyi +0 -0
  50. {imageio-2.34.1 → imageio-2.34.2}/imageio/config/plugins.py +0 -0
  51. {imageio-2.34.1 → imageio-2.34.2}/imageio/config/plugins.pyi +0 -0
  52. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/__init__.py +0 -0
  53. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/fetching.py +0 -0
  54. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/findlib.py +0 -0
  55. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/format.py +0 -0
  56. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/format.pyi +0 -0
  57. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/imopen.py +0 -0
  58. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/imopen.pyi +0 -0
  59. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/legacy_plugin_wrapper.py +0 -0
  60. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/legacy_plugin_wrapper.pyi +0 -0
  61. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/request.pyi +0 -0
  62. {imageio-2.34.1 → imageio-2.34.2}/imageio/core/v3_plugin_api.py +0 -0
  63. {imageio-2.34.1 → imageio-2.34.2}/imageio/freeze.py +0 -0
  64. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/__init__.py +0 -0
  65. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/_bsdf.py +0 -0
  66. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/_freeimage.py +0 -0
  67. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/_swf.py +0 -0
  68. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/_tifffile.py +0 -0
  69. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/bsdf.py +0 -0
  70. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/dicom.py +0 -0
  71. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/example.py +0 -0
  72. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/feisem.py +0 -0
  73. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/ffmpeg.py +0 -0
  74. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/fits.py +0 -0
  75. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/freeimage.py +0 -0
  76. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/freeimagemulti.py +0 -0
  77. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/gdal.py +0 -0
  78. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/grab.py +0 -0
  79. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/lytro.py +0 -0
  80. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/npz.py +0 -0
  81. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/opencv.py +0 -0
  82. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/pillow.py +0 -0
  83. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/pillow_info.py +0 -0
  84. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/pillowmulti.py +0 -0
  85. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/pyav.py +0 -0
  86. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/simpleitk.py +0 -0
  87. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/spe.py +0 -0
  88. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/swf.py +0 -0
  89. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/tifffile.py +0 -0
  90. {imageio-2.34.1 → imageio-2.34.2}/imageio/plugins/tifffile_v3.py +0 -0
  91. {imageio-2.34.1 → imageio-2.34.2}/imageio/py.typed +0 -0
  92. {imageio-2.34.1 → imageio-2.34.2}/imageio/testing.py +0 -0
  93. {imageio-2.34.1 → imageio-2.34.2}/imageio/typing.py +0 -0
  94. {imageio-2.34.1 → imageio-2.34.2}/imageio/v2.py +0 -0
  95. {imageio-2.34.1 → imageio-2.34.2}/imageio/v2.pyi +0 -0
  96. {imageio-2.34.1 → imageio-2.34.2}/imageio/v3.py +0 -0
  97. {imageio-2.34.1 → imageio-2.34.2}/imageio/v3.pyi +0 -0
  98. {imageio-2.34.1 → imageio-2.34.2}/imageio.egg-info/SOURCES.txt +0 -0
  99. {imageio-2.34.1 → imageio-2.34.2}/imageio.egg-info/dependency_links.txt +0 -0
  100. {imageio-2.34.1 → imageio-2.34.2}/imageio.egg-info/entry_points.txt +0 -0
  101. {imageio-2.34.1 → imageio-2.34.2}/imageio.egg-info/not-zip-safe +0 -0
  102. {imageio-2.34.1 → imageio-2.34.2}/imageio.egg-info/requires.txt +0 -0
  103. {imageio-2.34.1 → imageio-2.34.2}/imageio.egg-info/top_level.txt +0 -0
  104. {imageio-2.34.1 → imageio-2.34.2}/setup.cfg +0 -0
  105. {imageio-2.34.1 → imageio-2.34.2}/setup.py +0 -0
  106. {imageio-2.34.1 → imageio-2.34.2}/tests/test_bsdf.py +0 -0
  107. {imageio-2.34.1 → imageio-2.34.2}/tests/test_config.py +0 -0
  108. {imageio-2.34.1 → imageio-2.34.2}/tests/test_core.py +0 -0
  109. {imageio-2.34.1 → imageio-2.34.2}/tests/test_dicom.py +0 -0
  110. {imageio-2.34.1 → imageio-2.34.2}/tests/test_fei_tiff.py +0 -0
  111. {imageio-2.34.1 → imageio-2.34.2}/tests/test_fits.py +0 -0
  112. {imageio-2.34.1 → imageio-2.34.2}/tests/test_format.py +0 -0
  113. {imageio-2.34.1 → imageio-2.34.2}/tests/test_gdal.py +0 -0
  114. {imageio-2.34.1 → imageio-2.34.2}/tests/test_grab.py +0 -0
  115. {imageio-2.34.1 → imageio-2.34.2}/tests/test_legacy_plugin_wrapper.py +0 -0
  116. {imageio-2.34.1 → imageio-2.34.2}/tests/test_lytro.py +0 -0
  117. {imageio-2.34.1 → imageio-2.34.2}/tests/test_meta.py +0 -0
  118. {imageio-2.34.1 → imageio-2.34.2}/tests/test_npz.py +0 -0
  119. {imageio-2.34.1 → imageio-2.34.2}/tests/test_opencv.py +0 -0
  120. {imageio-2.34.1 → imageio-2.34.2}/tests/test_pillow_legacy.py +0 -0
  121. {imageio-2.34.1 → imageio-2.34.2}/tests/test_simpleitk.py +0 -0
  122. {imageio-2.34.1 → imageio-2.34.2}/tests/test_spe.py +0 -0
  123. {imageio-2.34.1 → imageio-2.34.2}/tests/test_swf.py +0 -0
  124. {imageio-2.34.1 → imageio-2.34.2}/tests/test_tifffile.py +0 -0
  125. {imageio-2.34.1 → imageio-2.34.2}/tests/test_tifffile_v3.py +0 -0
  126. {imageio-2.34.1 → imageio-2.34.2}/tests/test_v2.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imageio
3
- Version: 2.34.1
3
+ Version: 2.34.2
4
4
  Summary: Library for reading and writing a wide range of image, video, scientific, and volumetric data formats.
5
5
  Home-page: https://github.com/imageio/imageio
6
6
  Download-URL: http://pypi.python.org/pypi/imageio
@@ -16,7 +16,7 @@ Main website: https://imageio.readthedocs.io/
16
16
 
17
17
  # flake8: noqa
18
18
 
19
- __version__ = "2.34.1"
19
+ __version__ = "2.34.2"
20
20
 
21
21
  import warnings
22
22
 
@@ -697,6 +697,9 @@ class SeekableFileObject:
697
697
 
698
698
  return res
699
699
 
700
+ def readline(self):
701
+ yield from self._file.readline()
702
+
700
703
  def tell(self):
701
704
  return self._i
702
705
 
@@ -163,6 +163,8 @@ class Array(np.ndarray):
163
163
  return out.dtype.type(out) # Scalar
164
164
  elif out.shape != self.shape:
165
165
  return out.view(type=np.ndarray)
166
+ elif not isinstance(out, Array):
167
+ return Array(out, self.meta)
166
168
  else:
167
169
  return out # Type Array
168
170
 
@@ -531,7 +531,7 @@ class SimpleDicomReader(object):
531
531
  data = data.astype(np.float32)
532
532
  else:
533
533
  # Determine required range
534
- minReq, maxReq = data.min(), data.max()
534
+ minReq, maxReq = data.min().item(), data.max().item()
535
535
  minReq = min([minReq, minReq * slope + offset, maxReq * slope + offset])
536
536
  maxReq = max([maxReq, minReq * slope + offset, maxReq * slope + offset])
537
537
 
@@ -137,10 +137,8 @@ loop : int
137
137
  The number of iterations. Default 0 (meaning loop indefinitely).
138
138
  duration : {float, list}
139
139
  (Only available in GIF-PIL)
140
- The duration (in seconds) of each frame. Either specify one value
140
+ The duration (in milliseconds) of each frame. Either specify one value
141
141
  that is used for all frames, or one value for each frame.
142
- Note that in the GIF format the duration/delay is expressed in
143
- hundredths of a second, which limits the precision of the duration.
144
142
  fps : float
145
143
  (Only available in GIF-PIL)
146
144
  The number of frames per second. If duration is not given, the
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imageio
3
- Version: 2.34.1
3
+ Version: 2.34.2
4
4
  Summary: Library for reading and writing a wide range of image, video, scientific, and volumetric data formats.
5
5
  Home-page: https://github.com/imageio/imageio
6
6
  Download-URL: http://pypi.python.org/pypi/imageio
@@ -70,7 +70,7 @@ def working_directory(path):
70
70
 
71
71
 
72
72
  @pytest.fixture(scope="session")
73
- def test_images(request):
73
+ def test_images(request, pytestconfig):
74
74
  """A collection of test images.
75
75
 
76
76
  Note: The images are cached persistently (across test runs) in
@@ -81,6 +81,7 @@ def test_images(request):
81
81
  # downloaded once in the beginning
82
82
 
83
83
  checkout_dir = request.config.cache.get("imageio_test_binaries", None)
84
+ use_internet = "not needs_internet" not in pytestconfig.getoption("-m")
84
85
 
85
86
  if checkout_dir is not None and not Path(checkout_dir).exists():
86
87
  # cache value set, but cache is gone :( ... recreate
@@ -90,6 +91,8 @@ def test_images(request):
90
91
  # download test images and other binaries
91
92
  checkout_dir = Path(__file__).parents[1] / ".test_images"
92
93
 
94
+ if not checkout_dir.exists() and not use_internet:
95
+ pytest.skip("Internet use disabled and `.test_images` not found.")
93
96
  try:
94
97
  checkout_dir.mkdir()
95
98
  except FileExistsError:
@@ -103,14 +106,15 @@ def test_images(request):
103
106
 
104
107
  checkout_dir = Path(checkout_dir)
105
108
 
106
- with working_directory(checkout_dir):
107
- result = os.system("git pull")
109
+ if use_internet:
110
+ with working_directory(checkout_dir):
111
+ result = os.system("git pull")
108
112
 
109
- if result != 0:
110
- request.config.cache.set("imageio_test_binaries", None)
111
- raise RuntimeError(
112
- "Cache directory is corrupt. Delete `.test_images` at project root."
113
- )
113
+ if result != 0:
114
+ request.config.cache.set("imageio_test_binaries", None)
115
+ raise RuntimeError(
116
+ "Cache directory is corrupt. Delete `.test_images` at project root."
117
+ )
114
118
 
115
119
  return checkout_dir
116
120
 
@@ -175,12 +179,6 @@ def tmp_userdir(tmp_path):
175
179
  del os.environ[user_dir_env]
176
180
 
177
181
 
178
- def pytest_collection_modifyitems(items):
179
- for item in items:
180
- if "test_images" in getattr(item, "fixturenames", ()):
181
- item.add_marker("needs_internet")
182
-
183
-
184
182
  def deprecated_test(fn):
185
183
  @wraps(fn)
186
184
  def wrapper(*args, **kwargs):
@@ -30,6 +30,11 @@ imageio_ffmpeg = pytest.importorskip(
30
30
  "imageio_ffmpeg", reason="imageio-ffmpeg is not installed"
31
31
  )
32
32
 
33
+ try:
34
+ imageio_ffmpeg.get_ffmpeg_version()
35
+ except RuntimeError:
36
+ pytest.skip("No compatible FFMPEG binary could be found.", allow_module_level=True)
37
+
33
38
 
34
39
  def get_ffmpeg_pids():
35
40
  pids = set()
@@ -6,8 +6,14 @@ import pytest
6
6
  import imageio
7
7
  import sys
8
8
 
9
+ imageio_ffmpeg = pytest.importorskip(
10
+ "imageio_ffmpeg", reason="imageio-ffmpeg is not installed"
11
+ )
9
12
 
10
- pytest.importorskip("imageio_ffmpeg", reason="imageio-ffmpeg is not installed")
13
+ try:
14
+ imageio_ffmpeg.get_ffmpeg_version()
15
+ except RuntimeError:
16
+ pytest.skip("No compatible FFMPEG binary could be found.", allow_module_level=True)
11
17
 
12
18
 
13
19
  def dedent(text, dedent=8):
@@ -72,8 +72,11 @@ def setup_library(tmp_path_factory, vendored_lib):
72
72
  add = core.appdata_dir("imageio")
73
73
  os.makedirs(add, exist_ok=True)
74
74
  shutil.copytree(vendored_lib, os.path.join(add, "freeimage"))
75
+
76
+ try:
75
77
  fi.load_freeimage()
76
- assert fi.has_lib(), "imageio-binaries' version of libfreeimage was not found"
78
+ except OSError:
79
+ pytest.skip("Could not find a compatible FreeImage version for this OS.")
77
80
 
78
81
  yield
79
82
 
@@ -719,3 +719,13 @@ def test_avif_remote():
719
719
  url = "https://github.com/link-u/avif-sample-images/raw/master/fox.profile0.10bpc.yuv420.avif"
720
720
  im = iio.imread(url, plugin="pillow")
721
721
  assert im.shape == (800, 1204, 3)
722
+
723
+
724
+ @pytest.mark.needs_internet
725
+ def test_webp_remote():
726
+ # this is a regression test for
727
+ # https://github.com/imageio/imageio/issues/1065
728
+ # the image in the issue is actually a webp image
729
+ url = "https://github.com/python-pillow/Pillow/raw/main/Tests/images/hopper_orientation_2.webp"
730
+ im = iio.imread(url, plugin="pillow")
731
+ assert im.shape == (128, 128, 3)
@@ -424,8 +424,8 @@ def test_bayer_write():
424
424
 
425
425
  def test_sequential_reading(test_images):
426
426
  expected_imgs = [
427
- iio.imread(test_images / "cockatoo.mp4", index=1),
428
- iio.imread(test_images / "cockatoo.mp4", index=5),
427
+ iio.imread(test_images / "cockatoo.mp4", plugin="pyav", index=1),
428
+ iio.imread(test_images / "cockatoo.mp4", plugin="pyav", index=5),
429
429
  ]
430
430
 
431
431
  with iio.imopen(test_images / "cockatoo.mp4", "r", plugin="pyav") as img_file:
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
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
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