8000 fixes #17908 , updates frame_format to support all listed by animatio… · matplotlib/matplotlib@f2a5de4 · GitHub
[go: up one dir, main page]

Skip to content

Commit f2a5de4

Browse files
committed
fixes #17908 , updates frame_format to support all listed by animation writers
1 parent c54a5a9 commit f2a5de4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,8 @@ def validate_movie_writer(s):
747747

748748

749749
validate_movie_frame_fmt = ValidateInStrings(
750-
'animation.frame_format', ['png', 'jpeg', 'tiff', 'raw', 'rgba'],
750+
'animation.frame_format', ['png', 'jpeg', 'tiff', 'raw', 'rgba', 'ppm',
751+
'sgi', 'bmp', 'pbm', 'svg'],
751752
_deprecated_since="3.3")
752753
validate_axis_locator = ValidateInStrings(
753754
'major', ['minor', 'both', 'major'], _deprecated_since="3.3")
@@ -1491,7 +1492,8 @@ def _convert_validator_spec(key, conv):
14911492
"animation.codec": validate_string,
14921493
"animation.bitrate": validate_int,
14931494
# Controls image format when frames are written to disk
1494-
"animation.frame_format": ["png", "jpeg", "tiff", "raw", "rgba"],
1495+
"animation.frame_format": ["png", "jpeg", "tiff", "raw", "rgba", "ppm",
1496+
"sgi", "bmp", "pbm", "svg"],
14951497
# Additional arguments for HTML writer
14961498
"animation.html_args": validate_stringlist,
14971499
# Path to ffmpeg binary. If just binary name, subprocess uses $PATH.

lib/matplotlib/tests/test_rcparams.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,14 @@ def test_Issue_1713(tmpdir):
204204
assert rc.get('timezone') == 'UTC'
205205

206206

207+
def test_Issue_17908():
208+
# Animation frame_format should allow any of the following
209+
# if any of these are not allowed, an exception will be raised
210+
for fmt in ['png', 'jpeg', 'tiff', 'raw', 'rgba', 'ppm',
211+
'sgi', 'bmp', 'pbm', 'svg']:
212+
mpl.rcParams['animation.frame_format'] = fmt
213+
214+
207215
def generate_validator_testcases(valid):
208216
validation_tests = (
209217
{'validator': validate_bool,

0 commit comments

Comments
 (0)
0