edsdk-python icon indicating copy to clipboard operation
edsdk-python copied to clipboard

save_image.py error...

Open data-bonanza opened this issue 3 years ago • 5 comments

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

data-bonanza avatar Nov 26 '22 04:11 data-bonanza

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)

rissom avatar Aug 17 '23 13:08 rissom

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)

aerialvis avatar Nov 06 '23 03:11 aerialvis

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

AirplanegoBrr avatar Nov 13 '23 03:11 AirplanegoBrr

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

gustavo-alberto avatar Jan 09 '24 00:01 gustavo-alberto

yeah- thats what #2 does.

AirplanegoBrr avatar Jan 09 '24 22:01 AirplanegoBrr