cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Re: Python API - Getting image EXIF data

Python API - Getting image EXIF data

Jackaroo
Explorer | Level 3
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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
Explorer | Level 3
Go to solution

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
Dropbox Staff
Go to solution

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.

Need more support?