From 3ec70eeb5d4e8833cf0dff478296921adcc50bb7 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 30 Dec 2005 11:43:44 +0000 Subject: [PATCH] only try the "partial download" trick for JPEG/EXIF images. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8373 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/ptp2/ChangeLog | 5 +++++ camlibs/ptp2/library.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/camlibs/ptp2/ChangeLog b/camlibs/ptp2/ChangeLog index 8103b1daf..02f2121f3 100644 --- a/camlibs/ptp2/ChangeLog +++ b/camlibs/ptp2/ChangeLog @@ -1,3 +1,8 @@ +2005-12-30 Marcus Meissner + + * library.c: Only allow getpartialobject for EXIF + JPEG images. + 2005-12-29 Marcus Meissner * ptp.c, ptp.h, library.c: diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 9e249f3c3..51986b152 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -3569,7 +3569,12 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, /* Device may hang is a partial read is attempted beyond the file */ if (oi->ObjectCompressedSize < 10) return (GP_ERROR_NOT_SUPPORTED); - /* could also use Canon partial downloads */ + + /* We only support JPEG / EXIF format ... others might hang. */ + if (oi->ObjectFormat != PTP_OFC_EXIF_JPEG) + return (GP_ERROR_NOT_SUPPORTED); + + /* Note: Could also use Canon partial downloads */ CPR (context, ptp_getpartialobject (params, params->handles.Handler[object_id], 0, 10, &ximage));