We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

Jackaroo's avatar
Jackaroo
Explorer | Level 3
6 years ago
Solved

Python API - Getting image EXIF data

Hi,

 

I've been trying to get the EXIF data from images, mainly I'm after the image orientation. I can do it by using the

files_download_to_file

command and using python to get the EXIF data out later, but I'd rather use the

files_download

command. Any help would be greatly appreciated.

  • Can you elaborate on what part you're currently stuck on? Both files_download and files_download_to_file will give you the file data, with the difference being how the data is returned. For files_download, the data is returned in memory, in the object in the second return value. For files_download_to_file, it's saved to disk at the download_path location you specify.

     

    So, to use files_download for this, you'd need to take the returned file data in memory and then pass it to whatever code you're using to extract the EXIF data. There's an example of using files_download here.

3 Replies

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

    Can you elaborate on what part you're currently stuck on? Both files_download and files_download_to_file will give you the file data, with the difference being how the data is returned. For files_download, the data is returned in memory, in the object in the second return value. For files_download_to_file, it's saved to disk at the download_path location you specify.

     

    So, to use files_download for this, you'd need to take the returned file data in memory and then pass it to whatever code you're using to extract the EXIF data. There's an example of using files_download here.

  • Jackaroo's avatar
    Jackaroo
    Explorer | Level 3
    6 years ago

    Hi Greg, thanks for your response :grinning: I think I've found the answer! So When I opened the file initially I didn't specify the 'b' parameter... It now seems to be writing all of the EXIF data to the file. Thank you for your help, I wasn't sure if the EXIF data was contained in the files_download.

     

    I have another issue now though. I'm downloading these files from a shared folder, and I'd like to try and keep track of who uploads what. Is there an easy way of doing this? I've looked through the documentation but couldn't see anything obvious. Would it be better to open a separate thread for this?

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

    I'm glad to hear you got that working.

     

    I see you opened a new thread for your other question so I'll follow up with you there.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 9 months ago
411 Following

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 or Facebook.

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!