#151 Fix capture with nikon in trunk when target is card

None
closed-fixed
None
5
2013-10-31
2013-07-16
Cyrille Berger
No

Since [r14424] capture does not work with Nikon camera when capture is set to "card".

The reason is that in the following snippet "ret" is set to GP_OK, however camera_nikon_capture is only called if the target is "sdram". Meaning that in case the target is card, the last if will check GP_OK != GP_ERROR_NOT_SUPPORTED, and return GP_OK while not doing the capture !

l2974 of library.c:
if ( (params->deviceinfo.VendorExtensionID == PTP_VENDOR_NIKON) &&
(ptp_operation_issupported(params, PTP_OC_NIKON_Capture) ||
ptp_operation_issupported(params, PTP_OC_NIKON_AfCaptureSDRAM) ||
ptp_operation_issupported(params, PTP_OC_NIKON_InitiateCaptureRecInMedia)
)) {
int ret = GP_OK;
char buf[1024];

if ((GP_OK != gp_setting_get("ptp2","capturetarget",buf)) || !strcmp(buf,"sdram"))
    ret = camera_nikon_capture (camera, type, path, 1, context);
if (ret != GP_ERROR_NOT_SUPPORTED)
    return ret;

}

There are several ways to fix that problem,not sure which one you prefer, in attachment I have set ret to GP_ERROR_NOT_SUPPORTED, and that fixed the problem.

1 Attachments

Related

Commit: [r14424]

Discussion

  • ah , half done code.

    I changed it like you suggest for now, so it falls through to the generic code again.

    The newest opcode for capture allows selecting card or sdram so I might add code there in the near future.

     
    • assigned_to: Marcus Meissner
    • Group: -->
     
    • status: open --> closed-fixed
     
  • shopuld be fixed in svn