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

name 'height' is not defined #3

Open
schrockwell opened this issue Dec 20, 2024 · 1 comment
Open

name 'height' is not defined #3

schrockwell opened this issue Dec 20, 2024 · 1 comment

Comments

@schrockwell
Copy link

schrockwell commented Dec 20, 2024

❯ python converter.py --to-macpaint ~/Desktop/input.png ~/Desktop/output.mac
Traceback (most recent call last):
  File "/Users/rockwell/Projects/macpaint_file/converter.py", line 24, in <module>
    main(args)
  File "/Users/rockwell/Projects/macpaint_file/converter.py", line 11, in main
    macpaint_file = png.convert()
                    ^^^^^^^^^^^^^
  File "/Users/rockwell/Projects/macpaint_file/formats.py", line 131, in convert
    add_rows = MacPaintFile.HEIGHT - height
                                     ^^^^^^
NameError: name 'height' is not defined

If I change it to self.height I get a new error:

  File "/Users/rockwell/Projects/macpaint_file/macpaint.py", line 173, in _gen_packed_data
    assert len(bit_line) == cls.WIDTH / 8, f"error in condensing bytes into bits; line is only {len(bit_line)} bytes"
AssertionError: error in condensing bytes into bits; line is only 128 bytes

Here is the input PNG:
input

Any help would be appreciated, thank you.

@schrockwell
Copy link
Author

Figured it out... there was a math error when calculating how much padding to add. Fixed in #4.

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

No branches or pull requests

1 participant