Skip to content

Commit

Permalink
MAINT: ignore exclude_applied on legacy plugins (#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
FirefoxMetzger committed Jul 30, 2022
1 parent 21d5c73 commit f082dde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
9 changes: 2 additions & 7 deletions imageio/core/legacy_plugin_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ def metadata(self, index=None, exclude_applied: bool = True):
The index of the ndimage to read. If the index is out of bounds a
``ValueError`` is raised. If ``None``, global metadata is returned.
exclude_applied : bool
If True (default), do not report metadata fields that the plugin
would apply/consume while reading the image.
This parameter exists for compatibility and has no effect. Legacy
plugins always report all metadata they find.
Returns
-------
Expand All @@ -305,11 +305,6 @@ def metadata(self, index=None, exclude_applied: bool = True):
"""

if exclude_applied:
raise ValueError(
"Legacy plugins don't support excluding applied metadata fields."
)

if index is None:
index = _legacy_default_index(self._format)

Expand Down
7 changes: 0 additions & 7 deletions tests/test_legacy_plugin_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ def test_exception_message_bytes():
assert "<bytes>" in str(e)


def test_exclude_applied(test_images):
with pytest.raises(ValueError):
iio.v3.immeta(
test_images / "chelsea.png", exclude_applied=True, plugin="PNG-PIL"
)


def test_ellipsis_index(test_images):
img = iio.v3.imread(test_images / "chelsea.png", plugin="PNG-FI", index=...)
assert img.shape == (1, 300, 451, 3)
Expand Down

0 comments on commit f082dde

Please sign in to comment.