Closed pdeman closed 5 years ago
After getting the .jpg file you need to call gp_camera_wait_for_event
until you get a GP_EVENT_FILE_ADDED
event. The event data is the path of the .cr2 file which you can then fetch with gp_camera_file_get
.
ok thanks. I added error,eventype,file_path_cr2=gphoto2.gp_wait_for_event(camera,gphoto2.GP_EVENT_FILE_ADDED,context) and it seems to work. if for any reason the gp_event_file_added never arrived, is their a way to add a timeout ?
and about the difference between: imageformat imageformatexthd imageformatcf
any idea where I can find this info ?
That's not how gp_camera_wait_for_event
works. The second parameter is a timeout value (which is why the documentation calls it timeout
). You don't specify what event type to wait for, the function returns the event type and data it has received. You have to call it repeatedly until you get the event you want. See the log_events.py
and time_lapse.py
examples for typical uses. This was also discussed in #65.
I don't know anything about imageformat, imageformatexthd and imageformatcf.
ok thanks. I found this used of gp_camera_wait_for_event on an example on the web but it was a bad example apparently. thanks for the info.
Hi,
I am trying to take a photo using a canon 50D and get the raw (.cr2).
using shell I do:
gphoto2 --capture-image-and-download --filename xxx.%C
and it gives me the .jpg and the .cr2using python I did: