modern PowerShot SX also behave like EOS M

This commit is contained in:
Marcus Meissner
2018-10-29 08:39:46 +01:00
parent 7d242c5955
commit a42e213912

View File

@@ -115,7 +115,13 @@ is_canon_eos_m(PTPParams *params) {
if (params->deviceinfo.VendorExtensionID != PTP_VENDOR_CANON) return 0;
if (!ptp_operation_issupported(params, PTP_OC_CANON_EOS_SetRemoteMode)) return 0;
if (!params->deviceinfo.Model) return 0;
return !strncmp(params->deviceinfo.Model, "Canon EOS M", strlen("Canon EOS M"));
/* classic EOS M */
if (!strncmp(params->deviceinfo.Model, "Canon EOS M", strlen("Canon EOS M")))
return 1;
/* we encountered Powershot SX models that seem to have EOS M firmware, see https://github.com/gphoto/libgphoto2/issues/316 */
if (!strncmp(params->deviceinfo.Model, "Canon PowerShot SX", strlen("Canon PowerShot SX")))
return 1;
return 0;
}