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

Default config for manim project switches pixel_height with pixel_width #4174

Open
DominQu opened this issue Feb 21, 2025 · 1 comment · May be fixed by #4213
Open

Default config for manim project switches pixel_height with pixel_width #4174

DominQu opened this issue Feb 21, 2025 · 1 comment · May be fixed by #4213

Comments

@DominQu
Copy link

DominQu commented Feb 21, 2025

Description of bug / unexpected behavior

When following the quickstart guide, I created a manim project with the command: manim init project my-project --default. This created a manim.cfg file with the following contents:

[CLI]
frame_rate = 30
pixel_height = 854
pixel_width = 480
background_color = BLACK
background_opacity = 1
scene_names = Default

The values of pixel_height and pixel_width are switched. This leads to animations being zoomed in and wrong frame_width. When I set pixel_width=854 and pixel_height=480 everything goes back to normal.

Expected behavior

Default manim.cfg file contains proper resolution, that is:

[CLI]
frame_rate = 30
pixel_height = 480
pixel_width = 854
background_color = BLACK
background_opacity = 1
scene_names = Default

How to reproduce the issue

Code for reproducing the problem
manim init project my-project --default

Additionally, you can add a line: print(config.frame_width) to main.py in my-project and verify that the value of config.frame_width != 14.2(3).

Additional media files

Images/GIFs

Logs

Terminal output
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR

System specifications

System Details
  • OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): macOS 15.3
  • RAM:
  • Python version (python/py/python3 --version): 3.9
  • Installed modules (provide output from pip list):
manim==0.19.0
LaTeX details
  • LaTeX distribution (e.g. TeX Live 2020):
  • Installed LaTeX packages:

Additional comments

@StevenH34 StevenH34 linked a pull request Apr 7, 2025 that will close this issue
3 tasks
@StevenH34
Copy link

I made a PR fixing the issue.

The pixel_width and pixel_height were being set out of order.

# manim/cli/init/commands.py
if key == "resolution":
     cli_config["pixel_height"] = str(value[0])
     cli_config["pixel_width"] = str(value[1])

Swapping the values fixes the issue.

# manim/cli/init/commands.py
if key == "resolution":
     cli_config["pixel_width"] = str(value[0])
     cli_config["pixel_height"] = str(value[1])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants