Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading OSError message when saving an animation to an inexistent folder #34204

Open
seblabbe opened this issue Jul 21, 2022 · 5 comments
Open

Comments

@seblabbe
Copy link
Contributor

From this ask question, the command

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')

returns

Command "['convert', '-dispose', 'Background', '-delay', '20', '-loop',
'0', '*.png', '/home/slabbe/animations/sines.gif']" returned non-zero 
exit status "1" (with stderr "convert-im6.q16: unable to open image 
`/home/slabbe/animations/sines.gif': Aucun fichier ou dossier de ce 
type @ error/blob.c/OpenBlob/2874." and stdout "").
---------------------------------------------------------------------------
Traceback (most recent call last):
...
OSError: 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.

The problem is not that imagemagick is not functional.

The way error message are given as written in #33092 needs to be improved.

CC: @sagetrac-tmonteil

Component: graphics

Author: Sébastien Labbé

Branch/Commit: u/slabbe/34204 @ bc5851c

Issue created by migration from https://trac.sagemath.org/ticket/34204

@seblabbe seblabbe added this to the sage-9.7 milestone Jul 21, 2022
@seblabbe
Copy link
Contributor Author

Commit: bc5851c

@seblabbe
Copy link
Contributor Author

Branch: u/slabbe/34204

@seblabbe
Copy link
Contributor Author

New commits:

02b520534204: better error message when pathhead of savefile does not exist
bc5851c34204: moving the require() command just before features ffmpeg and imagemagick are used

@seblabbe
Copy link
Contributor Author

Author: Sébastien Labbé

@seblabbe
Copy link
Contributor Author

comment:2

Both:

sage -t src/sage/plot/animate.py
sage -t --optional=sage,optional,external src/sage/plot/animate.py

works for me. My setup is that I have both ffmpeg and imagemagick installed.

However, newly added doctests do not depend on ffmpeg or imagemagick because these features are "required" only after the new error message is raised.

Needs review.

@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants