Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'u/chapoton/28868' of ssh://trac.sagemath.org:22/sage in…
Browse files Browse the repository at this point in the history
…to img
  • Loading branch information
fchapoton committed Apr 4, 2020
2 parents 6a45805 + c011c93 commit 2b0806e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/sage/plot/animate.py
Expand Up @@ -99,7 +99,7 @@
REFERENCES:
- `ImageMagick <http://www.imagemagick.org>`_
- `ImageMagick <https://www.imagemagick.org>`_
- `FFmpeg <http://www.ffmpeg.org>`_
- `APNG <https://wiki.mozilla.org/APNG_Specification>`_
- `browsers which support it <http://caniuse.com/#feat=apng>`_
Expand Down Expand Up @@ -560,7 +560,7 @@ def gif(self, delay=20, savefile=None, iterations=0, show_path=False,
sage: td = tmp_dir()
sage: a.gif() # not tested
sage: a.gif(savefile=td + 'my_animation.gif', delay=35, iterations=3) # optional -- ImageMagick
sage: with open(td + 'my_animation.gif', 'rb') as f: print('\x21\xf9\x04\x08\x23\x00' in f.read()) # optional -- ImageMagick
sage: with open(td + 'my_animation.gif', 'rb') as f: print(b'\x21\xf9\x04\x08\x23\x00' in f.read()) # optional -- ImageMagick
True
sage: a.gif(savefile=td + 'my_animation.gif', show_path=True) # optional -- ImageMagick
Animation saved to .../my_animation.gif.
Expand Down Expand Up @@ -1053,26 +1053,26 @@ def save(self, filename=None, show_path=False, use_ffmpeg=False, **kwds):
GIF image (see :trac:`18176`)::
sage: a.save(td + 'wave.gif') # optional -- ImageMagick
sage: with open(td + 'wave.gif', 'rb') as f: print('!\xf9\x04\x08\x14\x00' in f.read()) # optional -- ImageMagick
sage: with open(td + 'wave.gif', 'rb') as f: print(b'!\xf9\x04\x08\x14\x00' in f.read()) # optional -- ImageMagick
True
sage: with open(td + 'wave.gif', 'rb') as f: print('!\xff\x0bNETSCAPE2.0\x03\x01\x00\x00\x00' in f.read()) # optional -- ImageMagick
sage: with open(td + 'wave.gif', 'rb') as f: print(b'!\xff\x0bNETSCAPE2.0\x03\x01\x00\x00\x00' in f.read()) # optional -- ImageMagick
True
sage: a.save(td + 'wave.gif', delay=35) # optional -- ImageMagick
sage: with open(td + 'wave.gif', 'rb') as f: print('!\xf9\x04\x08\x14\x00' in f.read()) # optional -- ImageMagick
sage: with open(td + 'wave.gif', 'rb') as f: print(b'!\xf9\x04\x08\x14\x00' in f.read()) # optional -- ImageMagick
False
sage: with open(td + 'wave.gif', 'rb') as f: print('!\xf9\x04\x08\x23\x00' in f.read()) # optional -- ImageMagick
sage: with open(td + 'wave.gif', 'rb') as f: print(b'!\xf9\x04\x08\x23\x00' in f.read()) # optional -- ImageMagick
True
sage: a.save(td + 'wave.gif', iterations=3) # optional -- ImageMagick
sage: with open(td + 'wave.gif', 'rb') as f: print('!\xff\x0bNETSCAPE2.0\x03\x01\x00\x00\x00' in f.read()) # optional -- ImageMagick
sage: with open(td + 'wave.gif', 'rb') as f: print(b'!\xff\x0bNETSCAPE2.0\x03\x01\x00\x00\x00' in f.read()) # optional -- ImageMagick
False
sage: with open(td + 'wave.gif', 'rb') as f: print('!\xff\x0bNETSCAPE2.0\x03\x01\x03\x00\x00' in f.read()) # optional -- ImageMagick
sage: with open(td + 'wave.gif', 'rb') as f: print(b'!\xff\x0bNETSCAPE2.0\x03\x01\x02\x00\x00' in f.read()) # optional -- ImageMagick
True
"""
if filename is None:
suffix = '.gif'
else:
suffix = os.path.splitext(filename)[1]
if len(suffix) == 0:
if not suffix:
suffix = '.gif'

if filename is None or suffix == '.gif':
Expand Down

0 comments on commit 2b0806e

Please sign in to comment.