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

Malformed Py5Shape objects if Processing's loadShape() returns null #354

Closed
hx2A opened this issue Sep 24, 2023 · 0 comments
Closed

Malformed Py5Shape objects if Processing's loadShape() returns null #354

hx2A opened this issue Sep 24, 2023 · 0 comments

Comments

@hx2A
Copy link
Collaborator

hx2A commented Sep 24, 2023

py5 encountered an error in your code:

File "/home/villares/GitHub/sketch-a-day/2023/sketch_2023_09_23/sketch_2023_09_23.py", line 40, in draw
    24   def draw():
 (...)
    36           elif isinstance(thumb, py5.Py5Image):
    37               rw = thumb.width
    38               func = py5.image
    39           elif isinstance(thumb, py5.Py5Shape):
--> 40               w, h = thumb.get_width(), thumb.get_height()
    41               ratio = w / h
    ..................................................
     w = 64.0
     h = 64.0
    ..................................................

AttributeError: 'NoneType' object has no attribute 'getWidth'

Originally posted by @villares in #352 (comment)

Somehow thumb._instance was None. The _load_py5shape decorator should check for this.

@hx2A hx2A mentioned this issue Oct 1, 2023
@hx2A hx2A closed this as completed in 8d7697a Oct 1, 2023
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