Marcus Meissner
b980e30f63
- libusb1: do not crash immediately (avoid global context usage) - canon: --wait-for-event append \0 to filename - ptp2: new USB ids, fixed Canon EOS thumbnail retrieval OBS-URL: https://build.opensuse.org/package/show/graphics/libgphoto2?expand=0&rev=69
117 lines
4.8 KiB
Diff
117 lines
4.8 KiB
Diff
diff -ru ./camlibs/canon/canon.c /home/marcus/projects/libgphoto2-2_4/libgphoto2/camlibs/canon/canon.c
|
|
--- camlibs/canon/canon.c 2012-03-30 23:23:47.000000000 +0200
|
|
+++ camlibs/canon/canon.c 2012-07-19 20:19:15.693782425 +0200
|
|
@@ -1333,8 +1333,7 @@
|
|
if ( is_image ( new_name ) ) {
|
|
/* Yup, we'll assume that this is the new image. */
|
|
GP_DEBUG ( " Found our new image file" );
|
|
- strncpy ( path->name, new_name,
|
|
- strlen ( new_name ) );
|
|
+ strcpy ( path->name, new_name );
|
|
strcpy ( path->folder, canon2gphotopath ( camera, path->folder ) );
|
|
|
|
/* FIXME: Marcus: make it less large effort... */
|
|
diff -ru ./camlibs/ptp2/library.c /home/marcus/projects/libgphoto2-2_4/libgphoto2/camlibs/ptp2/library.c
|
|
--- camlibs/ptp2/library.c 2012-04-15 17:11:15.000000000 +0200
|
|
+++ camlibs/ptp2/library.c 2012-07-19 20:19:15.686782359 +0200
|
|
@@ -715,7 +715,7 @@
|
|
{"Nikon:Coolpix L110 (PTP mode)", 0x04b0, 0x017e, PTP_CAP},
|
|
|
|
/* miguel@rozsas.eng.br */
|
|
- {"Nikon:Coolpix P500 (PTP mode)", 0x04b0, 0x0184, 0},
|
|
+ {"Nikon:Coolpix P500 (PTP mode)", 0x04b0, 0x0184, PTP_CAP},
|
|
/* Graeme Wyatt <graeme.wyatt@nookawarra.com> */
|
|
{"Nikon:Coolpix L120 (PTP mode)", 0x04b0, 0x0185, PTP_CAP},
|
|
/* Kévin Ottens <ervin@ipsquad.net> */
|
|
@@ -740,6 +740,8 @@
|
|
{"Nikon:Coolpix S8000 (PTP mode)",0x04b0, 0x021f, 0},
|
|
/* Aleksej Serdjukov <deletesoftware@yandex.ru> */
|
|
{"Nikon:Coolpix S5100 (PTP mode)",0x04b0, 0x0220, 0},
|
|
+ /* wlady.cs@gmail.com */
|
|
+ {"Nikon:Coolpix P300 (PTP mode)", 0x04b0, 0x0221, 0},
|
|
/* Nikon Coolpix 2000 */
|
|
{"Nikon:Coolpix 2000 (PTP mode)", 0x04b0, 0x0302, 0},
|
|
/* From IRC reporter. */
|
|
@@ -810,6 +812,11 @@
|
|
/* IRC Reporter popolon */
|
|
{"Nikon:DSC D5100 (PTP mode)", 0x04b0, 0x0429, PTP_CAP|PTP_CAP_PREVIEW},
|
|
|
|
+
|
|
+ /* http://sourceforge.net/tracker/?func=detail&aid=3536904&group_id=8874&atid=108874 */
|
|
+ {"Nikon:V1", 0x04b0, 0x0601, PTP_CAP},
|
|
+
|
|
+
|
|
#if 0
|
|
/* Thomas Luzat <thomas.luzat@gmx.net> */
|
|
/* this was reported as not working, mass storage only:
|
|
@@ -1058,6 +1065,8 @@
|
|
|
|
/* Martin Lasarsch at SUSE. MTP_PROPLIST returns just 0 entries */
|
|
{"Canon:Digital IXUS 90 IS", 0x04a9, 0x3174, PTPBUG_DELETE_SENDS_EVENT},
|
|
+ /* Daniel Moyne <daniel.moyne@free.fr> */
|
|
+ {"Canon:Powershot SD790 IS", 0x04a9, 0x3174, PTPBUG_DELETE_SENDS_EVENT},
|
|
|
|
/* https://sourceforge.net/tracker/?func=detail&aid=2722422&group_id=8874&atid=358874 */
|
|
{"Canon:Digital IXUS 85 IS", 0x04a9, 0x3174, PTPBUG_DELETE_SENDS_EVENT},
|
|
@@ -1289,6 +1298,9 @@
|
|
{"Apple:iPod Touch 3rd Gen (PTP mode)", 0x05ac, 0x1299, 0},
|
|
{"Apple:iPad (PTP mode)", 0x05ac, 0x129a, 0},
|
|
|
|
+ /* Don Cohen <don-sourceforge-xxzw@isis.cs3-inc.com> */
|
|
+ {"Apple:iPhone 4S (PTP mode)", 0x05ac, 0x12a0, 0},
|
|
+
|
|
/* https://sourceforge.net/tracker/index.php?func=detail&aid=1869653&group_id=158745&atid=809061 */
|
|
{"Pioneer:DVR-LX60D", 0x08e4, 0x0142, 0},
|
|
|
|
@@ -4555,12 +4567,14 @@
|
|
unsigned char *ximage = NULL;
|
|
unsigned int xlen = 0;
|
|
|
|
- /* If thumb size is 0 then there is no thumbnail at all... */
|
|
- if((size=oi->ThumbCompressedSize)==0) return (GP_ERROR_NOT_SUPPORTED);
|
|
+ size=oi->ThumbCompressedSize;
|
|
+ /* If thumb size is 0 and the OFC is not a image type (0x3800 / 0xb800)... */
|
|
+ if ((size==0) && ((oi->ObjectFormat & 0x7800) != 0x3800))
|
|
+ return GP_ERROR_NOT_SUPPORTED;
|
|
CPR (context, ptp_getthumb(params,
|
|
params->handles.Handler[object_id],
|
|
&ximage, &xlen));
|
|
- if (xlen != size)
|
|
+ if (size && (xlen != size))
|
|
gp_log (GP_LOG_ERROR, "get_file_func/GP_FILE_TYPE_PREVIEW", "size mismatch %d vs %d", size, xlen);
|
|
set_mimetype (camera, file, params->deviceinfo.VendorExtensionID, oi->ThumbFormat);
|
|
CR (gp_file_set_data_and_size (file, (char*)ximage, xlen));
|
|
diff -ru ./libgphoto2_port/libusb1/libusb1.c /home/marcus/projects/libgphoto2-2_4/libgphoto2/libgphoto2_port/libusb1/libusb1.c
|
|
--- libgphoto2_port/libusb1/libusb1.c 2012-03-26 21:34:10.000000000 +0200
|
|
+++ libgphoto2_port/libusb1/libusb1.c 2012-07-19 20:05:50.066206830 +0200
|
|
@@ -119,6 +119,7 @@
|
|
GPPortInfo info;
|
|
int nrofdevices = 0;
|
|
int d, i, i1, i2, unknownint;
|
|
+ libusb_context *ctx;
|
|
|
|
/* generic matcher. This will catch passed XXX,YYY entries for instance. */
|
|
info.type = GP_PORT_USB;
|
|
@@ -126,8 +127,8 @@
|
|
strcpy (info.path, "^usb:");
|
|
CHECK (gp_port_info_list_append (list, info));
|
|
|
|
- libusb_init (NULL);
|
|
- gp_nrofdevs = load_devicelist (NULL);
|
|
+ libusb_init (&ctx);
|
|
+ gp_nrofdevs = load_devicelist (ctx);
|
|
|
|
for (d = 0; d < gp_nrofdevs; d++) {
|
|
/* Devices which are definitely not cameras. */
|
|
@@ -239,7 +240,9 @@
|
|
strcpy (info.path, "usb:");
|
|
CHECK (gp_port_info_list_append (list, info));
|
|
}
|
|
- libusb_exit (NULL);
|
|
+ libusb_exit (ctx);
|
|
+ gp_nrofdevs = 0;
|
|
+ gp_devs = NULL;
|
|
return (GP_OK);
|
|
}
|
|
|