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

save_image.py error... #1

Open
data-bonanza opened this issue Nov 26, 2022 · 5 comments
Open

save_image.py error... #1

data-bonanza opened this issue Nov 26, 2022 · 5 comments

Comments

@data-bonanza
Copy link

Thank you for your edsdk-python code.

I am trying this "save_image.py"

There are two problem.

(1) 'PropertyEvent' is not defined

def callback_property(event: PropertyEvent, property_id: PropID, parameter: int) -> int:

NameError: name 'PropertyEvent' is not defined

(2) result is None, None

is it right?

Computer is connected to the EOS Canon camera with USB.

image

@rissom
Copy link

rissom commented Aug 17, 2023

Same here.
When I just delete the PropertyEvent type constraint from the function I get:

File "C:\Users\thorsten.rissom\source\repos\edsdk-python\examples\save_image.py", line 63, in
print(edsdk.GetPropertyData(cam, PropID.SaveTo))
TypeError: EdsGetPropertyData() takes exactly 3 arguments (2 given)

@aerialvis
Copy link

Same here. You can also comment this line out and it works for me.

Same here. When I just delete the PropertyEvent type constraint from the function I get:

File "C:\Users\thorsten.rissom\source\repos\edsdk-python\examples\save_image.py", line 63, in print(edsdk.GetPropertyData(cam, PropID.SaveTo)) TypeError: EdsGetPropertyData() takes exactly 3 arguments (2 given)

@AirplanegoBrr
Copy link

The PropertyEvent is missing in the callback_property function, however, callback_property is never even called so it could be removed or an example of it could be added
GetPropertyData should be defaulting to 0 if its not provided but it seems that, that doesn't work

@gustavo-alberto
Copy link

Looks like the callback_property function is trying to access the PropertyEvent but don't find it because is not imported. So I added the PropertyEvent in the from edsdk import () and commented the print(edsdk.GetPropertyData(cam, PropID.SaveTo)) in the main function. It worked.

Added the PropertyEvent in import
image

Commented the print in main function
image

@AirplanegoBrr
Copy link

yeah- thats what #2 does.

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

5 participants