Comments (6)
@Cephir23 That may be because you have already used the bugged version of gif-for-cli
. When gif-for-cli reads a GIF, it creates a cache directory for the image where it places a config.json
, which contains num_frames
. Once that config is created, it will remain the same on each execution, so num_frames
should still be 0, causing a divide by zero error. On my system (probably yours as well since you use Arch), the cache directory is ~/.cache/gif-for-cli/1.1.2
. If there are any directories in the cache, try removing them and rerunning gif-for-cli
.
from gif-for-cli.
@Cephir23 That may be because you have already used the bugged version of
gif-for-cli
. When gif-for-cli reads a GIF, it creates a cache directory for the image where it places aconfig.json
, which containsnum_frames
. Once that config is created, it will remain the same on each execution, sonum_frames
should still be 0, causing a divide by zero error. On my system (probably yours as well since you use Arch), the cache directory is~/.cache/gif-for-cli/1.1.2
. If there are any directories in the cache, try removing them and rerunninggif-for-cli
.
Worked! Thank you so much.
from gif-for-cli.
I have exactly the same problem, any workarounds?
from gif-for-cli.
@FrancoCorleone You could manually edit gif_for_cli/generate/__init__.py
to add my fixes Add missing "rows" option in _save_config and Add fallback regex method to _run_ffmpeg. If you are on arch, the files should be in ~/.local/lib/python3.11/site-packages/gif_for_cli-1.1.2-py3.11.egg/
. If not, check the path in your error message.
Edit: If you don't feel like manually editing, you could also replace gif_for_cli/generate/__init__.py
with the one from my repo.
from gif-for-cli.
Same issue here.
[cephir@archlinux]$ gif-for-cli
Traceback (most recent call last):
File "/home/cephir/.local/bin/gif-for-cli", line 8, in
sys.exit(main())
^^^^^^
File "/home/cephir/.local/lib/python3.11/site-packages/gif_for_cli/main.py", line 23, in main
execute(os.environ, sys.argv[1:], sys.stdout)
File "/home/cephir/.local/lib/python3.11/site-packages/gif_for_cli/execute.py", line 94, in execute
seconds_per_frame=config['seconds'] / config['num_frames'],
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: float division by zero
I tried replacing gif_for_cli/generate/init.py with the one from your repo, but it doesn't work for me.
from gif-for-cli.
num_fames is on: gif_for_cli/generate/init.py
just replace it
- num_frames = int(re.search(r'frame=\s*(\d+)', err).group(1))
- num_frames = len(glob.glob1('{}/'.format(output_dirnames['jpg']),"*.jpg"))
https://github.com/Lepidos/gif-for-cli/blob/master/gif_for_cli/generate/__init__.py
from gif-for-cli.
Related Issues (20)
- Support saving generated data to a file for local playback HOT 2
- Support for Raspberry Pi HOT 4
- Error: get error in testing HOT 4
- AttributeError: 'NoneType' object has no attribute 'group' when using remote gif URL HOT 5
- ZeroDivisionError: float division by zero HOT 5
- readme fails to mention WHICH ansi escape sequences are supported HOT 1
- --export does not work with local files HOT 2
- --export cuts off right half of gif when using -c HOT 2
- Gifs with blank backgrounds are generated with white backgrounds
- Automation of unit tests.
- Make better image accuracy by improving the algorithm
- Python3 devel requirement HOT 6
- It sees the file (local save and from a remote source) but sees it as empty (Ubuntu VM))
- Gif
- Windows cmd.exe and Powershell support HOT 12
- Process and play in separate calls HOT 1
- No such file or directory error HOT 6
- Why? HOT 5
- Subgif feature HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gif-for-cli.