cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Ross uses Dropbox to answer some new house questions here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python API - Getting image EXIF data

Python API - Getting image EXIF data

Jackaroo
Explorer | Level 3

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.

1 Accepted Solution

Accepted Solutions

Re: Python API - Getting image EXIF data

Greg-DB
Dropboxer

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.

View solution in original post

3 Replies 3

Re: Python API - Getting image EXIF data

Greg-DB
Dropboxer

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.

View solution in original post

Re: Python API - Getting image EXIF data

Jackaroo
Explorer | Level 3

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?

Re: Python API - Getting image EXIF data

Greg-DB
Dropboxer

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.

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    Jackaroo Explorer | Level 3
What do Dropbox user levels mean?
Need more support?