diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 7abde998778a..3c8bcf7d9c6f 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -747,7 +747,8 @@ def validate_movie_writer(s): validate_movie_frame_fmt = ValidateInStrings( - 'animation.frame_format', ['png', 'jpeg', 'tiff', 'raw', 'rgba'], + 'animation.frame_format', ['png', 'jpeg', 'tiff', 'raw', 'rgba', 'ppm', + 'sgi', 'bmp', 'pbm', 'svg'], _deprecated_since="3.3") validate_axis_locator = ValidateInStrings( 'major', ['minor', 'both', 'major'], _deprecated_since="3.3") @@ -1491,7 +1492,8 @@ def _convert_validator_spec(key, conv): "animation.codec": validate_string, "animation.bitrate": validate_int, # Controls image format when frames are written to disk - "animation.frame_format": ["png", "jpeg", "tiff", "raw", "rgba"], + "animation.frame_format": ["png", "jpeg", "tiff", "raw", "rgba", "ppm", + "sgi", "bmp", "pbm", "svg"], # Additional arguments for HTML writer "animation.html_args": validate_stringlist, # Path to ffmpeg binary. If just binary name, subprocess uses $PATH. diff --git a/lib/matplotlib/tests/test_rcparams.py b/lib/matplotlib/tests/test_rcparams.py index b34577a3ee93..97ae564af1fe 100644 --- a/lib/matplotlib/tests/test_rcparams.py +++ b/lib/matplotlib/tests/test_rcparams.py @@ -204,6 +204,15 @@ def test_Issue_1713(tmpdir): assert rc.get('timezone') == 'UTC' +def test_animation_frame_formats(): + # Animation frame_format should allow any of the following + # if any of these are not allowed, an exception will be raised + # test for gh issue #17908 + for fmt in ['png', 'jpeg', 'tiff', 'raw', 'rgba', 'ppm', + 'sgi', 'bmp', 'pbm', 'svg']: + mpl.rcParams['animation.frame_format'] = fmt + + def generate_validator_testcases(valid): validation_tests = ( {'validator': validate_bool,