Ask Your Question
1

saving animation problem

asked 2022-07-20 08:56:09 +0200

anonymous user

Anonymous

updated 2023-01-09 23:59:56 +0200

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

edit retag flag offensive close merge delete

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 ( 2022-07-21 05:19:08 +0200 )edit

@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 ( 2022-07-21 12:53:02 +0200 )edit

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 ( 2022-07-21 16:01:50 +0200 )edit

Great .

tmonteil gravatar imagetmonteil ( 2022-07-21 16:21:36 +0200 )edit

#34204 now needs review

Sébastien gravatar imageSébastien ( 2022-08-24 18:07:49 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2022-07-20 20:08:21 +0200

tmonteil gravatar image

updated 2022-07-21 12:55:36 +0200

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.

edit flag offensive delete link more

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: 2022-07-20 08:56:09 +0200

Seen: 206 times

Last updated: Jul 21 '22