You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
dnaz
8 months agoExplorer | Level 3
How can I get images width and height values in pixel with API V2
I have created an api with PHP language, I can connect list folders and files etc.. But I cant get the images width and height with api, How can I do this with the latest api documentation ?
https://www.dropbox.com/developers/documentation/http/documentation
I have sent request with
"include_media_info": true
But there is no values depends on the width and height of images, How can I solve this ?
- ЗдравкоLegendary | Level 20
Hi dnaz,
To get image or video media info in metadata you need to call /2/files/get_metadata endpoint. The media info is not supported on other endpoints for number of years already.
Hope this helps.
- dnazExplorer | Level 3
Hi, I have used it but cant get the width and height.
- ЗдравкоLegendary | Level 20
I just tried for an arbitrary image and its as follows (a bit shortened for clarity):
> POST /2/files/get_metadata > Host: https://api.dropboxapi.com > User-Agent: api-explorer-client > Authorization: Bearer ***********valid*access*token******** > Content-Type: application/json > > {"path":"/IMG_20230616_150044.jpg","include_media_info":true} < HTTP/2 200 < content-type: application/json < server: envoy < content-length: 568 < < {".tag": "file", "name": "IMG_20230616_150044.jpg", "path_lower": "/img_20230616_150044.jpg", "path_display": "/IMG_20230616_150044.jpg", "id": "id:ElL7W-JPrdMAAAAAAABaqQ", "client_modified": "2023-06-16T12:01:28Z", "server_modified": "2023-06-16T12:01:29Z", "rev": "5fe3df1f1b42b22ab554a", "size": 1649795, "media_info": {".tag": "metadata", "metadata": {".tag": "photo", "dimensions": {"height": 4000, "width": 1840}, "time_taken": "2023-06-16T15:00:44Z"}}, "is_downloadable": true, "content_hash": "a373008e6d8daf0d0823cd623d38a949548d26d08f42a779cbf8ebde12c213cc"}
As can be seen both width and height are there. What exactly doesn't work for you?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,888 PostsLatest Activity: 3 hours agoIf 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!