Skip to content

Commit

Permalink
bugfix #600
Browse files Browse the repository at this point in the history
Removed the reader stub (use the base class reader instead). Also added a test that explicitly uses
`pilmode` to check if it is avaiable when using gif.
  • Loading branch information
FirefoxMetzger committed Feb 21, 2021
1 parent 6671504 commit b0a20de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 1 addition & 3 deletions imageio/plugins/pillowmulti.py
Expand Up @@ -55,9 +55,7 @@ class GIFFormat(PillowFormat):
_modes = "iI"
_description = "Static and animated gif (Pillow)"

class Reader(PillowFormat.Reader):
def _open(self, playback=None): # compat with FI format
return PillowFormat.Reader._open(self)
# GIF reader needs no modifications compared to base pillow reader

class Writer(PillowFormat.Writer):
def _open(
Expand Down
7 changes: 7 additions & 0 deletions tests/test_pillow.py
Expand Up @@ -258,6 +258,13 @@ def test_gif():
raises(TypeError, imageio.imread, fname, notavalidkwarg=True)
raises(TypeError, imageio.imsave, fnamebase + "1.gif", im, notavalidk=True)

def test_gif_pilmode():
# Bug found in issue #600
image = np.asarray(imageio.mimread("imageio:newtonscradle.gif", pilmode="RGB"))
assert np.array_equal(image.shape, (36, 150, 200, 3))

image = np.asarray(imageio.mimread("imageio:newtonscradle.gif", pilmode="RGBA"))
assert np.array_equal(image.shape, (36, 150, 200, 4))

def test_animated_gif():

Expand Down

0 comments on commit b0a20de

Please sign in to comment.