diff options
Diffstat (limited to 'camlibs/ptp2/library.c')
-rw-r--r-- | camlibs/ptp2/library.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index cfba9b739..389f07965 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -4555,12 +4555,14 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, 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)); |