diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2017-03-16 15:43:29 +0100 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2017-03-16 15:43:29 +0100 |
commit | 7101499271f5d5a4e38b0b3740f98b20c15afe3a (patch) | |
tree | 6136d7d35c99a06e8bb8af9c8379c536dfa31f06 | |
parent | e0c7545e9cd25ec9aaa507df9c48a944108f4f84 (diff) | |
download | libgphoto2-7101499271f5d5a4e38b0b3740f98b20c15afe3a.tar.gz |
add support for RAW_PLUS in downloaders.
unify format selection in wait_event with capture-image
-rw-r--r-- | camlibs/pentax/library.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/camlibs/pentax/library.c b/camlibs/pentax/library.c index 5fca3da56..cbe9fe860 100644 --- a/camlibs/pentax/library.c +++ b/camlibs/pentax/library.c @@ -276,12 +276,14 @@ camera_capture (Camera *camera, CameraCaptureType type, CameraFilePath *path, pslr_shutter (p); strcpy (path->folder, "/"); + gp_log (GP_LOG_ERROR, "pentax", "image format image=0x%x, raw=0x%x", status.image_format, status.raw_format); switch (status.image_format) { case PSLR_IMAGE_FORMAT_JPEG: sprintf (path->name, "capt%04d.jpg", capcnt++); mime = GP_MIME_JPEG; break; - case PSLR_IMAGE_FORMAT_RAW:; + case PSLR_IMAGE_FORMAT_RAW_PLUS: /* FIXME: the same as _RAW ? */ + case PSLR_IMAGE_FORMAT_RAW: switch (status.raw_format) { case PSLR_RAW_FORMAT_PEF: sprintf (path->name, "capt%04d.pef", capcnt++); @@ -384,15 +386,28 @@ camera_wait_for_event (Camera *camera, int timeout, const char *mime; path = malloc(sizeof(CameraFilePath)); strcpy (path->folder, "/"); - if (status.image_format == PSLR_IMAGE_FORMAT_JPEG) { + switch (status.image_format) { + case PSLR_IMAGE_FORMAT_JPEG: sprintf (path->name, "capt%04d.jpg", capcnt++); mime = GP_MIME_JPEG; - } else if (status.image_format == PSLR_IMAGE_FORMAT_RAW && - status.raw_format == PSLR_RAW_FORMAT_PEF) { - sprintf (path->name, "capt%04d.pef", capcnt++); - mime = GP_MIME_RAW; - } else { - gp_log (GP_LOG_ERROR, "pentax", "waitevent unknown format image=0x%x, raw=0x%x", status.image_format, status.raw_format); + break; + case PSLR_IMAGE_FORMAT_RAW_PLUS: /* FIXME: the same as _RAW ? */ + case PSLR_IMAGE_FORMAT_RAW: + switch (status.raw_format) { + case PSLR_RAW_FORMAT_PEF: + sprintf (path->name, "capt%04d.pef", capcnt++); + mime = GP_MIME_RAW; + break; + case PSLR_RAW_FORMAT_DNG: + sprintf (path->name, "capt%04d.dng", capcnt++); + mime = "image/x-adobe-dng"; + break; + default: + gp_log (GP_LOG_ERROR, "pentax", "unknown format image=0x%x, raw=0x%x", status.image_format, status.raw_format); + return GP_ERROR; + } + default: + gp_log (GP_LOG_ERROR, "pentax", "unknown format image=0x%x (raw=0x%x)", status.image_format, status.raw_format); return GP_ERROR; } |