diff options
author | Philip Langdale <philipl@overt.org> | 2012-08-18 15:32:12 -0700 |
---|---|---|
committer | Linus Walleij <triad@df.lth.se> | 2012-08-19 01:35:02 +0200 |
commit | 99351a4162033a479030f200a5da99542482c18b (patch) | |
tree | 240dc99d197b683020635aec78be00eb8eec68f5 /src/libmtp.c | |
parent | 062c65e2dccf42cadd3d914cf84f18da7c7ccbdd (diff) | |
download | libmtp-99351a4162033a479030f200a5da99542482c18b.tar.gz |
Expose the getthumbnail method.
Even though this is theoretically obsolete in MTP, it may still
be the only working mechanism to obtain thumbnails from an MTP
device.
Signed-off-by: Philip Langdale <philipl@overt.org>
Diffstat (limited to 'src/libmtp.c')
-rw-r--r-- | src/libmtp.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libmtp.c b/src/libmtp.c index bf03b61..e271614 100644 --- a/src/libmtp.c +++ b/src/libmtp.c @@ -8773,6 +8773,24 @@ int LIBMTP_Get_Representative_Sample(LIBMTP_mtpdevice_t *device, } /** + * Retrieve the thumbnail for a file. + * @param device a pointer to the device to get the thumbnail from. + * @param id the object ID of the file to retrieve the thumbnail for. + * @return 0 on success, any other value means failure. + */ +int LIBMTP_Get_Thumbnail(LIBMTP_mtpdevice_t *device, uint32_t const id, + unsigned char **data, unsigned int *size) +{ + PTPParams *params = (PTPParams *) device->params; + uint16_t ret; + + ret = ptp_getthumb(params, id, data, size); + if (ret == PTP_RC_OK) + return 0; + return -1; +} + +/** * This routine updates an album based on the metadata * supplied. If the <code>tracks</code> field of the metadata * contains a track listing, these tracks will be added to the |