From 29f9db961969caea04f40db67eeea33b5b024b32 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Tue, 3 Feb 2004 13:08:48 +0000 Subject: [PATCH] Fix file size problems git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@7099 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/canon/ChangeLog | 5 +++++ camlibs/canon/canon.c | 2 ++ camlibs/canon/canon.h | 1 + camlibs/canon/serial.c | 2 +- camlibs/canon/usb.c | 2 +- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/camlibs/canon/ChangeLog b/camlibs/canon/ChangeLog index c195b023f..5d03332b7 100644 --- a/camlibs/canon/ChangeLog +++ b/camlibs/canon/ChangeLog @@ -1,3 +1,8 @@ +2004-02-03 Hans Ulrich Niedermann + + * usb.c: Use largest file size limit + * canon.c, canon.h: Note improper use of file size limits + 2004-01-31 Marcus Meissner * canon.c, canon.h: Richard Simpson diff --git a/camlibs/canon/canon.c b/camlibs/canon/canon.c index 67fb9892c..8c0c47d29 100644 --- a/camlibs/canon/canon.c +++ b/camlibs/canon/canon.c @@ -83,6 +83,8 @@ * detection. * - Newer Canon USB cameras also support a PTP mode. See ptp2 camlib. * - No IEEE1394 cameras supported yet. + * - The size limit constants aren't used properly anywhere. We should + * probably get rid of them altogether. **/ /* SL_* - size limit constants */ diff --git a/camlibs/canon/canon.h b/camlibs/canon/canon.h index 588f9d231..bbb098507 100644 --- a/camlibs/canon/canon.h +++ b/camlibs/canon/canon.h @@ -258,6 +258,7 @@ struct canonCamModelData unsigned short usb_vendor; unsigned short usb_product; canonCaptureSupport usb_capture_support; + /* these three constants aren't used properly */ unsigned int max_movie_size; unsigned int max_thumbnail_size; unsigned int max_picture_size; diff --git a/camlibs/canon/serial.c b/camlibs/canon/serial.c index b0f69247b..c201d986c 100644 --- a/camlibs/canon/serial.c +++ b/camlibs/canon/serial.c @@ -1058,7 +1058,7 @@ canon_serial_get_file (Camera *camera, const char *name, int *length, GPContext if (!file) { total = le32atoh (msg + 4); - if (total > camera->pl->md->max_picture_size) { + if (total > camera->pl->md->max_movie_size) { GP_DEBUG ("ERROR: %d is too big\n", total); break; } diff --git a/camlibs/canon/usb.c b/camlibs/canon/usb.c index cf21aada3..22d6868c9 100644 --- a/camlibs/canon/usb.c +++ b/camlibs/canon/usb.c @@ -1178,7 +1178,7 @@ canon_usb_get_file (Camera *camera, const char *name, unsigned char **data, int /* the 1 is to show status */ res = canon_usb_long_dialogue (camera, CANON_USB_FUNCTION_GET_FILE, data, length, - camera->pl->md->max_picture_size, payload, + camera->pl->md->max_movie_size, max_file_size, payload, payload_length, 1, context); if (res != GP_OK) { GP_DEBUG ("canon_usb_get_file: canon_usb_long_dialogue() "