Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Mojtaba433's avatar
Mojtaba433
New member | Level 2
3 years ago

How to get description or caption from the info (metadata) of an image using Python API.

I want to get the "description" or "caption" from the info (metadata) of an image using Python API. I use the 

"files_get_metadata" method but the result doesn't include all the info of the image (only size, name, path, etc).
I would appreciate it if you could help me to get all the info on the image such as "description" or "caption".
 
Regards

3 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    3 years ago

    It sounds like you're looking for other metadata embedded in image, such as using Exif. While the Dropbox API directly exposes information from some of these fields, as you found, it does not offer the ability to retrieve all of them, such as other fields like "description" and "caption". I'll pass this along as a feature request, but I can't promise if or when that might be implemented though. That being the case, you'd need to download the image data and extract the image metadata in your code to access those fields.

  • Mojtaba433's avatar
    Mojtaba433
    New member | Level 2
    3 years ago

    Thanks for your quick reply.

    I tried to download the images and extract the metadata but unfortunately, not all metadata is available after downloading. Do you suggest any specific method of downloading that keeps all metadata including caption and description?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    3 years ago

    When you using the files_download (or files_download_to_file) functionality, Dropbox will return the exact data that it has for the file. Dropbox does not modify the data that it receives when a file is uploaded, so if the embedded metadata is not present in the returned data, it means that it was not present when the file was uploaded.

     

    That being the case, make sure the embedded metadata is included in the file when you originally upload it. Otherwise, you may need to debug the process by which you extract the embedded metadata. That process, e.g., of reading Exif data from an image file, is outside the scope of Dropbox support though, so I'm afraid I can't offer specific guidance on that. You should refer to the resources for whatever code you're using to extract the embedded metadata, if you're using a third party library to do so, for instance.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!