summaryrefslogtreecommitdiff
path: root/camlibs
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2022-05-09 13:40:44 +0200
committerMarcus Meissner <marcus@jet.franken.de>2022-05-09 13:40:49 +0200
commiteac2eb34b3fb214c4bed10ad4e20b17606de110c (patch)
treecf437f493ecd35e247291ed91310fe9976cca6a0 /camlibs
parent2c8aaa575ad9aa9dfdc37ca363c10e8904455074 (diff)
downloadlibgphoto2-eac2eb34b3fb214c4bed10ad4e20b17606de110c.tar.gz
also set info for sony captured images
https://github.com/gphoto/libgphoto2/issues/794
Diffstat (limited to 'camlibs')
-rw-r--r--camlibs/ptp2/library.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c
index cfed29839..2d330ab9c 100644
--- a/camlibs/ptp2/library.c
+++ b/camlibs/ptp2/library.c
@@ -6899,6 +6899,27 @@ downloadnow:
ptp_free_objectinfo (&oi);
return ret;
}
+
+ /* we also get the fs info for free, so just set it */
+ info.file.fields = GP_FILE_INFO_TYPE |
+ GP_FILE_INFO_WIDTH | GP_FILE_INFO_HEIGHT |
+ GP_FILE_INFO_SIZE | GP_FILE_INFO_MTIME;
+ strcpy_mime (info.file.type, params->deviceinfo.VendorExtensionID, oi.ObjectFormat);
+ info.file.width = oi.ImagePixWidth;
+ info.file.height = oi.ImagePixHeight;
+ info.file.size = oi.ObjectCompressedSize;
+ info.file.mtime = time(NULL);
+
+ info.preview.fields = GP_FILE_INFO_TYPE |
+ GP_FILE_INFO_WIDTH | GP_FILE_INFO_HEIGHT |
+ GP_FILE_INFO_SIZE;
+ strcpy_mime (info.preview.type, params->deviceinfo.VendorExtensionID, oi.ThumbFormat);
+ info.preview.width = oi.ThumbPixWidth;
+ info.preview.height = oi.ThumbPixHeight;
+ info.preview.size = oi.ThumbCompressedSize;
+ GP_LOG_D ("setting fileinfo in fs");
+ gp_filesystem_set_info_noop(camera->fs, path->folder, path->name, info, context);
+
*eventtype = GP_EVENT_FILE_ADDED;
*eventdata = path;
/* We have now handed over the file, disclaim responsibility by unref. */