Ask Your Question
1

saving animation problem

asked 2 years ago

anonymous user

Anonymous

updated 2 years ago

tmonteil gravatar image
sines = [plot(c*sin(x), (-2*pi,2*pi), color=Color(c,0,0), ymin=-1, ymax=1) for c in srange(0,1,.1)]
a = animate(sines)
a.save('animations/sines')

When running this code I get the following error:

Error: Cannot generate GIF animation. The convert command (ImageMagick) is present but does not seem to be functional. Verify that the objects passed to the animate command can be saved in PNG image format. See www.imagemagick.org more information.

I can find the .gif in .sage/tmp/mymachine/44754 and move it, but using the save command would be much easier. I am on Sagemath 9.5 and Ubuntu 22.04

Preview: (hide)

Comments

What is the result of the following (does it return True as well) ?:

sage: from sage.features.imagemagick import ImageMagick
sage: ImageMagick().is_present()
FeatureTestResult('imagemagick', True)

What is the result of convert -list Format | grep PNG ? Note that feature checks for imagemagick were added in #33092

Sébastien gravatar imageSébastien ( 2 years ago )

@Sébastien : the return code is not handled correclty (you can reproduce the error with imagemagick properly installed), i am not sure the return codes of imagemagick are documented somewhere.

tmonteil gravatar imagetmonteil ( 2 years ago )

Right, I see. I created #34204. I will work on this after vacation in August/September. Feel free to propose a branch meanwhile.

Sébastien gravatar imageSébastien ( 2 years ago )

Great .

tmonteil gravatar imagetmonteil ( 2 years ago )

#34204 now needs review

Sébastien gravatar imageSébastien ( 2 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 2 years ago

tmonteil gravatar image

updated 2 years ago

I can not tell for sure but i bet the following: there is no animations/ directory within the directory from which you launched Sage jupyter notebook. So you can just run the a.save('sines') or a.save('sines.gif') to be more explicit, or you could first create the animations/ directory and make it writeable by the user that starts Sage.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2 years ago

Seen: 428 times

Last updated: Jul 21 '22