Jiloc / edsdk-python

Canon EDSDK wrapper for Python
MIT License
37 stars 16 forks source link

save_image.py error... #1

Open data-bonanza opened 2 years ago

data-bonanza commented 2 years ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 10 months ago

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 commented 10 months ago

yeah- thats what #2 does.